Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/geth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nohup ./build/bin/geth --datadir=${OP_DATA_DIR} --gcmode=archive migrate --state

## verifyMigration
```
geth verifyMigrate --chaindata=${erigon_chaindata_path} --datadir=${op_data_dir} --standalone-smt=true
geth verifyMigrate --chaindata=${ERIGON_CHAINDATA_DIR} --datadir=${OP_DATA_DIR} --standalone-smt=true
```

## unit test
Expand Down
4 changes: 1 addition & 3 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,6 @@ func verifyGenesisInternal(ctx *cli.Context, alloc types.GenesisAlloc, blockNumb
// Collect results
var verifiedCount int64
var errorCount int64
var ignoredCount int64

// Process results as they come in
for result := range resultChan {
Expand Down Expand Up @@ -1021,13 +1020,12 @@ func verifyGenesisInternal(ctx *cli.Context, alloc types.GenesisAlloc, blockNumb
if errorCount == 0 {
log.Info("✅ Genesis verification successful",
"accounts_verified", verifiedCount,
"accounts_ignored", ignoredCount,
"elapsed", common.PrettyDuration(time.Since(start)))
} else {
log.Error("❌ Genesis verification failed",
"errors", errorCount,
"accounts_verified", verifiedCount,
"accounts_ignored", ignoredCount)
"accounts_ignored")
return fmt.Errorf("verification failed with %d errors", errorCount)
}

Expand Down
8 changes: 8 additions & 0 deletions core/erigonStorageLayout.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ func GetExecutorSlot(account common.Address) (common.Hash, common.Hash) {
executorRoleId := common.HexToHash("0xd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e63")
return roleLayout(executorRoleId, account)
}

func CalculateBatchInboxAddr(chainID common.Hash) common.Address {
versionByte := byte(0x00)
var out common.Address
out[0] = versionByte
copy(out[1:], keccak256.Hash(chainID[:])[:19])
return out
}
9 changes: 9 additions & 0 deletions core/erigonStorageLayout_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package core

import (
"github.com/stretchr/testify/assert"
"math/big"
"testing"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -29,3 +31,10 @@ func TestGetExecutorSlot_Deterministic(t *testing.T) {
t.Errorf("ADMIN_SLOT should be equal to zero")
}
}

func TestCalculateBatchInboxAddr(t *testing.T) {
chainId := LeftPadBytes(big.NewInt(196).Bytes(), 32)
chainIdHash := common.BytesToHash(chainId)
addr := CalculateBatchInboxAddr(chainIdHash)
assert.Equal(t, "0x002bdE9b0c0857AEE2cFFDea6b8723eAF5989449", addr.Hex())
}