Skip to content

Commit 6dc432b

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/giga-evmonly-get-validators
# Conflicts: # giga/evmonly/precompiles/staking/endblock.go # giga/evmonly/precompiles/staking/helpers_test.go # giga/evmonly/precompiles/staking/layout.go # giga/evmonly/precompiles/staking/layout_test.go # giga/evmonly/precompiles/staking/storage.go # giga/evmonly/precompiles/staking/testdata/StakingStorageHarness.bin-runtime # giga/evmonly/precompiles/staking/testdata/StakingStorageHarness.sol # giga/evmonly/precompiles/staking/testdata/staking_storage_layout.json
2 parents 8a6aa88 + 06ad847 commit 6dc432b

80 files changed

Lines changed: 1548 additions & 1203 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎cmd/autobahn-e2e/aws_remote.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func seiLoadAWSConfig(privateIPs []string) (string, error) {
236236
endpoints[i] = fmt.Sprintf("http://%s:%d", ip, awsEVMPort)
237237
}
238238
cfg := map[string]any{
239-
"chainId": 713715,
239+
"chainId": 713700,
240240
"seiChainID": "autobahn-evmonly",
241241
"endpoints": endpoints,
242242
"accounts": map[string]any{

‎contracts/test/lib.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,10 @@ function _wrapSignerWithNonceRetry(signer) {
687687
return signer
688688
}
689689

690-
// EVM chain ID of the Autobahn EVM-only executor (AutobahnEVMOnlyChainID in
691-
// sei-tendermint/config/autobahn.go). That chain has no Cosmos accounts, so an
690+
// EVM chain ID docker/localnode gives the Autobahn EVM-only executor (the
691+
// --evm-chain-id of gen-autobahn-config). That chain has no Cosmos accounts, so an
692692
// EVM address has no Sei address to look up.
693-
const EVM_ONLY_CHAIN_ID = 713715
693+
const EVM_ONLY_CHAIN_ID = 713700
694694

695695
// isEvmOnlyChain reports whether the network under test is the Autobahn
696696
// EVM-only chain.

‎docker/localnode/scripts/step4_config_override.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ if [ "$AUTOBAHN" = "true" ]; then
190190
if [ -n "$EVM_GOVERNANCE_VOTING_PERIOD" ]; then
191191
GOVERNANCE_FLAGS="--evm-governance-voting-period $EVM_GOVERNANCE_VOTING_PERIOD"
192192
fi
193-
seid tendermint gen-autobahn-config $NODE_DIRS $GOVERNANCE_FLAGS --output "$AUTOBAHN_CONFIG"
193+
# contracts/test/lib.js and integration_test/autobahn sign for this EVM chain ID.
194+
seid tendermint gen-autobahn-config $NODE_DIRS $GOVERNANCE_FLAGS --evm-chain-id 713700 --output "$AUTOBAHN_CONFIG"
194195
if [ -n "$EVM_ALLOC" ]; then
195196
jq --argjson alloc "$EVM_ALLOC" '.evm_alloc = $alloc' "$AUTOBAHN_CONFIG" > "$AUTOBAHN_CONFIG.tmp" ||
196197
{ echo "ERROR: EVM_ALLOC is not valid JSON" >&2; exit 1; }

‎docker/rpcnode/scripts/step1_configure_init.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ if [ "$AUTOBAHN" = "true" ]; then
140140
if [ -n "$EVM_GOVERNANCE_VOTING_PERIOD" ]; then
141141
GOVERNANCE_FLAGS="--evm-governance-voting-period $EVM_GOVERNANCE_VOTING_PERIOD"
142142
fi
143-
seid tendermint gen-autobahn-config $NODE_DIRS $GOVERNANCE_FLAGS --output "$AUTOBAHN_CONFIG"
143+
# contracts/test/lib.js and integration_test/autobahn sign for this EVM chain ID.
144+
seid tendermint gen-autobahn-config $NODE_DIRS $GOVERNANCE_FLAGS --evm-chain-id 713700 --output "$AUTOBAHN_CONFIG"
144145
if [ -n "$EVM_ALLOC" ]; then
145146
jq --argjson alloc "$EVM_ALLOC" '.evm_alloc = $alloc' "$AUTOBAHN_CONFIG" > "$AUTOBAHN_CONFIG.tmp" ||
146147
{ echo "ERROR: EVM_ALLOC is not valid JSON" >&2; exit 1; }

‎giga/apphash/builder/apphash_builder_config.go‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ type AppHashBuilderConfig struct {
3939
// Whether the builder writes each app hash it builds to a hash log, as a debugging aid.
4040
HashLogEnabled bool
4141

42-
// Configures the hash log. Read only if HashLogEnabled. Its Path and Version have no default and must be set,
43-
// and its Path must not be shared with another hash logger. Only the fields a hashlog.HashLogWriter reads
44-
// apply.
42+
// Configures the hash log, read only if HashLogEnabled.
4543
HashLogConfig hashlog.HashLoggerConfig
4644
}
4745

48-
// Returns an AppHashBuilderConfig holding every default. HashVaultConfig.Path has no default and must be set.
46+
// Returns an AppHashBuilderConfig holding every default. HashVaultConfig.Path and HashLogConfig.Path have no default
47+
// and must be set.
4948
func DefaultAppHashBuilderConfig() AppHashBuilderConfig {
5049
hashVault := seiwal.DefaultConfig("", "app_hash_vault")
5150
hashVault.FsyncOnFlush = true
@@ -58,7 +57,7 @@ func DefaultAppHashBuilderConfig() AppHashBuilderConfig {
5857
ReadCursorIdleTimeout: 60 * time.Second,
5958
HashVaultConfig: *hashVault,
6059
HashLogEnabled: false,
61-
HashLogConfig: *hashlog.DefaultHashLoggerConfig("", ""),
60+
HashLogConfig: *hashlog.DefaultHashLoggerConfig("", "unknown"),
6261
}
6362
}
6463

@@ -82,5 +81,10 @@ func (c *AppHashBuilderConfig) Validate() error {
8281
if err := c.HashVaultConfig.Validate(); err != nil {
8382
return fmt.Errorf("invalid hash vault config: %w", err)
8483
}
84+
if c.HashLogEnabled {
85+
if err := c.HashLogConfig.Validate(); err != nil {
86+
return fmt.Errorf("invalid hash log config: %w", err)
87+
}
88+
}
8589
return nil
8690
}

‎giga/apphash/builder/apphash_builder_test.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/sei-protocol/sei-chain/giga/apphash/vault"
1818
)
1919

20-
const testChainID uint64 = 713715
20+
const testChainID uint64 = 713700
2121

2222
// How long a test waits for the builder to publish an app hash.
2323
const publishTimeout = 10 * time.Second
@@ -103,13 +103,14 @@ func closeBuilder(b *StandardAppHashBuilder) error {
103103
return errors.Join(b.Close(), b.vault.Close())
104104
}
105105

106-
// testConfig returns the default configuration for the test chain, with its hash vault in dir and its giga activation
107-
// at gigaActivationHeight.
106+
// testConfig returns the default configuration for the test chain, with its hash vault in dir, its giga activation
107+
// at gigaActivationHeight, and no hash log.
108108
func testConfig(dir string, gigaActivationHeight uint64) AppHashBuilderConfig {
109109
config := DefaultAppHashBuilderConfig()
110110
config.ChainID = testChainID
111111
config.GigaActivationHeight = gigaActivationHeight
112112
config.HashVaultConfig.Path = dir
113+
config.HashLogEnabled = false
113114
return config
114115
}
115116

‎giga/apphash/builder/hash_log_test.go‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,6 @@ func TestHashLogRecordsEachAppHashBuilt(t *testing.T) {
9595
}
9696
}
9797

98-
func TestHashLogThatFailsToOpenDoesNotStopBuilder(t *testing.T) {
99-
config := hashLoggingConfig(t.TempDir())
100-
config.HashLogConfig.Version = ""
101-
b, err := openBuilderWithConfig(t.Context(), config)
102-
require.NoError(t, err)
103-
t.Cleanup(func() { _ = closeBuilder(b) })
104-
105-
require.NoError(t, b.SetupComplete(context.Background(), 0))
106-
reportLoggedBlock(t, b, 1, 0)
107-
requireSameAppHashes(t, expectedChain(1, 1, 1), awaitAppHashes(t, b, 1, 1))
108-
}
109-
11098
func TestChangedAppHashIsFlushedToHashLogBeforeCrash(t *testing.T) {
11199
dir := requireScenarioPanics(t, "stored-ahead-hash-log", func(t *testing.T, dir string) {
112100
buildChain(t, filepath.Join(dir, "vault"), 5)

‎giga/evmonly/executor_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
const (
30-
testChainID = 713715
30+
testChainID = 713700
3131
testFundedBalanceWei = 200_000_000_000_000
3232
testGasPriceWei = 1_000_000_000
3333
)

‎giga/evmonly/rpc/access_list_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestCreateAccessListEndToEnd(t *testing.T) {
5858
t.Run(tc.name, func(t *testing.T) {
5959
var gotMsg *core.Message
6060
backend := &testBackend{
61-
chainID: func() uint64 { return 713715 },
61+
chainID: func() uint64 { return 713700 },
6262
baseFee: func() *big.Int { return new(big.Int) },
6363
blockNumber: func() uint64 { return 0 },
6464
createAccessList: func(_ context.Context, msg *core.Message) (ethtypes.AccessList, *core.ExecutionResult, error) {
@@ -123,7 +123,7 @@ func TestEstimateGasAfterCalls(t *testing.T) {
123123
return 42_000, nil, nil
124124
}
125125
backend := &testBackend{
126-
chainID: func() uint64 { return 713715 },
126+
chainID: func() uint64 { return 713700 },
127127
baseFee: func() *big.Int { return new(big.Int) },
128128
blockNumber: func() uint64 { return 0 },
129129
estimateGas: func(_ context.Context, msg *core.Message, gasCap uint64) (uint64, []byte, error) {
@@ -221,7 +221,7 @@ func TestEstimateGasAfterCallsRunsAgainstAPastBlock(t *testing.T) {
221221

222222
func TestEstimateGasAfterCallsCapComesFromConfig(t *testing.T) {
223223
backend := &testBackend{
224-
chainID: func() uint64 { return 713715 },
224+
chainID: func() uint64 { return 713700 },
225225
baseFee: func() *big.Int { return new(big.Int) },
226226
}
227227
limits := noRPCLimits

‎giga/evmonly/rpc/block_test.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func secondSignedTransaction(t *testing.T) (*ethtypes.Transaction, []byte) {
4242
To: &to,
4343
Value: big.NewInt(2),
4444
})
45-
tx, err = ethtypes.SignTx(tx, ethtypes.LatestSignerForChainID(big.NewInt(713715)), key)
45+
tx, err = ethtypes.SignTx(tx, ethtypes.LatestSignerForChainID(big.NewInt(713700)), key)
4646
require.NoError(t, err)
4747
raw, err := tx.MarshalBinary()
4848
require.NoError(t, err)
@@ -56,7 +56,7 @@ func fixedGasLimitBackend(t *testing.T, gasLimit uint64, block func(context.Cont
5656
return &testBackend{
5757
block: block,
5858
gasLimit: func() uint64 { return gasLimit },
59-
chainConfig: func() *params.ChainConfig { return testChainConfig(big.NewInt(713715)) },
59+
chainConfig: func() *params.ChainConfig { return testChainConfig(big.NewInt(713700)) },
6060
baseFee: func() *big.Int { return new(big.Int) },
6161
}
6262
}
@@ -191,10 +191,10 @@ func TestEncodeBlockEmptyBlockHasZeroGasUsedAndNoTransactions(t *testing.T) {
191191
func multiTxBlock(t *testing.T, height int64, blockHash common.Hash, blockTime time.Time) (*coretypes.ResultBlock, *ethtypes.Transaction, *ethtypes.Transaction, receipt.ReceiptStore) {
192192
t.Helper()
193193
tx1, raw1 := testSignedTransaction(t)
194-
sender1, err := ethtypes.Sender(ethtypes.LatestSignerForChainID(big.NewInt(713715)), tx1)
194+
sender1, err := ethtypes.Sender(ethtypes.LatestSignerForChainID(big.NewInt(713700)), tx1)
195195
require.NoError(t, err)
196196
tx2, raw2 := secondSignedTransaction(t)
197-
sender2, err := ethtypes.Sender(ethtypes.LatestSignerForChainID(big.NewInt(713715)), tx2)
197+
sender2, err := ethtypes.Sender(ethtypes.LatestSignerForChainID(big.NewInt(713700)), tx2)
198198
require.NoError(t, err)
199199

200200
store := evmonly.NewMemoryReceiptStore()
@@ -814,7 +814,7 @@ func TestGetTransactionByBlockAndIndexMatchesGetBlockFullTransactions(t *testing
814814
blockTime := time.Unix(1_700_000_000, 0)
815815
twoTxBlock, _, _, twoTxStore := multiTxBlock(t, 9, blockHash, blockTime)
816816
tx, raw := testSignedTransaction(t)
817-
sender, err := ethtypes.Sender(ethtypes.LatestSignerForChainID(big.NewInt(713715)), tx)
817+
sender, err := ethtypes.Sender(ethtypes.LatestSignerForChainID(big.NewInt(713700)), tx)
818818
require.NoError(t, err)
819819
oneTxBlock := &coretypes.ResultBlock{
820820
BlockID: tmtypes.BlockID{Hash: blockHash.Bytes()},

0 commit comments

Comments
 (0)