Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1286e90
InitLastHeader
pompon0 Jul 10, 2026
83ebfc9
changed defaults
pompon0 Jul 10, 2026
3ae26f4
init fix
pompon0 Jul 10, 2026
bea7c5c
changed readiness signal
pompon0 Jul 10, 2026
0a3b50f
fixes
pompon0 Jul 10, 2026
4b6e218
conditional statesync
pompon0 Jul 10, 2026
938076d
updated tests
pompon0 Jul 10, 2026
cb430dc
switched to evm handling
pompon0 Jul 11, 2026
488d686
pre-commit query fix
pompon0 Jul 11, 2026
7d59c9b
genesis tx fix
pompon0 Jul 11, 2026
c71cc3d
conditional proxying
pompon0 Jul 11, 2026
0e8f795
test fix
pompon0 Jul 11, 2026
a83325d
Merge remote-tracking branch 'origin/main' into gprusak-evm-start3
pompon0 Jul 11, 2026
60080e1
more fixes
pompon0 Jul 11, 2026
433c3da
more fixes
pompon0 Jul 12, 2026
70dc88c
more fixes
pompon0 Jul 12, 2026
155c338
heavier tx?
pompon0 Jul 12, 2026
269dfde
some bullshit
pompon0 Jul 13, 2026
a649a1c
helpers dedup
pompon0 Jul 13, 2026
f93a5d5
simplify
pompon0 Jul 13, 2026
c931ea9
golang improvements
pompon0 Jul 13, 2026
c6f98c4
updates
pompon0 Jul 13, 2026
02ad2d8
missing files
pompon0 Jul 13, 2026
eb4c28b
addressed comments
pompon0 Jul 13, 2026
b5d3490
applied comments
pompon0 Jul 13, 2026
41dfedb
more fixes
pompon0 Jul 13, 2026
c088f11
fixes
pompon0 Jul 13, 2026
3867df2
debug
pompon0 Jul 13, 2026
7543d79
fix
pompon0 Jul 13, 2026
5b44c29
again
pompon0 Jul 13, 2026
65d4d7b
again
pompon0 Jul 13, 2026
646608e
again
pompon0 Jul 13, 2026
a519f9f
again
pompon0 Jul 13, 2026
e70dd2e
again
pompon0 Jul 13, 2026
e38febe
fix
pompon0 Jul 14, 2026
6c766e0
logger
pompon0 Jul 14, 2026
1d5e176
removed ctx from InitChain
pompon0 Jul 14, 2026
6575b1a
simplified Application API
pompon0 Jul 14, 2026
470d8e5
snapshot
pompon0 Jul 14, 2026
e5812ea
improved
pompon0 Jul 14, 2026
f6e7f28
removed special cases
pompon0 Jul 14, 2026
f1554af
explicit genesis processing
pompon0 Jul 15, 2026
772b3cc
IsGenesis only for InitChainer
pompon0 Jul 15, 2026
9920a5a
test fixes
pompon0 Jul 15, 2026
ca5a7a8
snapshot:
pompon0 Jul 15, 2026
8e76c4d
mock is gone
pompon0 Jul 15, 2026
3a94888
snapshot
pompon0 Jul 15, 2026
a24c628
test fixes
pompon0 Jul 15, 2026
453ca49
removed noop code
pompon0 Jul 15, 2026
1f26888
test fix
pompon0 Jul 15, 2026
f9f4654
Merge remote-tracking branch 'origin/main' into gprusak-evm-start3
pompon0 Jul 15, 2026
809f5a7
better precision
pompon0 Jul 15, 2026
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
16 changes: 3 additions & 13 deletions app/ante/cosmos_checktx.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ func CosmosStatelessChecks(tx sdk.Tx, height int64, consensusParams *tmproto.Con

func SetGasMeter(ctx sdk.Context, gasLimit uint64, paramsKeeper paramskeeper.Keeper) sdk.Context {
cosmosGasParams := paramsKeeper.GetCosmosGasParams(ctx)

if ctx.BlockHeight() == 0 {
return ctx.WithGasMeter(storetypes.NewInfiniteMultiplierGasMeter(cosmosGasParams.CosmosGasMultiplierNumerator, cosmosGasParams.CosmosGasMultiplierDenominator))
}

return ctx.WithGasMeter(storetypes.NewMultiplierGasMeter(gasLimit, cosmosGasParams.CosmosGasMultiplierNumerator, cosmosGasParams.CosmosGasMultiplierDenominator))
}

Expand Down Expand Up @@ -450,15 +445,10 @@ func CheckSignatures(ctx sdk.Context, txConfig client.TxConfig, tx sdk.Tx, signe
}

// retrieve signer data
genesis := ctx.BlockHeight() == 0
chainID := ctx.ChainID()
var accNum uint64
if !genesis {
accNum = signerAcc.GetAccountNumber()
}
signerData := authsigning.SignerData{
ChainID: chainID,
AccountNumber: accNum,
AccountNumber: signerAcc.GetAccountNumber(),
Sequence: signerAcc.GetSequence(),
}

Expand All @@ -468,9 +458,9 @@ func CheckSignatures(ctx sdk.Context, txConfig client.TxConfig, tx sdk.Tx, signe
if authante.OnlyLegacyAminoSigners(sig.Data) {
// If all signers are using SIGN_MODE_LEGACY_AMINO, we rely on VerifySignature to check account sequence number,
// and therefore communicate sequence number as a potential cause of error.
errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d), sequence (%d) and chain-id (%s)", accNum, signerAcc.GetSequence(), chainID)
errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d), sequence (%d) and chain-id (%s)", signerAcc.GetAccountNumber(), signerAcc.GetSequence(), chainID)
} else {
errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d) and chain-id (%s)", accNum, chainID)
errMsg = fmt.Sprintf("signature verification failed; please verify account number (%d) and chain-id (%s)", signerAcc.GetAccountNumber(), chainID)
}
return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, errMsg)

Expand Down
4 changes: 2 additions & 2 deletions app/antedecorators/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ func GetGasMeterSetter(pk paramskeeper.Keeper) func(bool, sdk.Context, uint64, s
return func(simulate bool, ctx sdk.Context, gasLimit uint64, tx sdk.Tx) sdk.Context {
cosmosGasParams := pk.GetCosmosGasParams(ctx)

// In simulation, still use multiplier but with infinite gas limit
if simulate || ctx.BlockHeight() == 0 {
// In simulation and genesis delivery, still use multiplier but with infinite gas limit.
if simulate || ctx.IsGenesis() {
return ctx.WithGasMeter(types.NewInfiniteMultiplierGasMeter(cosmosGasParams.CosmosGasMultiplierNumerator, cosmosGasParams.CosmosGasMultiplierDenominator))
}

Expand Down
62 changes: 16 additions & 46 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,6 @@ type App struct {

forkInitializer func(sdk.Context)

httpServerStartSignal chan struct{}
wsServerStartSignal chan struct{}
httpServerStartSignalSent bool
wsServerStartSignalSent bool

// evmHTTPServer/evmWSServer hold the EVM JSON-RPC HTTP and WebSocket listeners
// constructed in RegisterLocalServices so an embedding orchestrator (the
// in-process harness) can Stop() them at teardown. Nil when the respective
Expand Down Expand Up @@ -539,21 +534,19 @@ func New(
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey, banktypes.DeferredCacheStoreKey, oracletypes.MemStoreKey)

app := &App{
BaseApp: bApp,
cdc: cdc,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
keys: keys,
tkeys: tkeys,
memKeys: memKeys,
txDecoder: encodingConfig.TxConfig.TxDecoder(),
versionInfo: version.NewInfo(),
metricCounter: &map[string]float32{},
encodingConfig: encodingConfig,
legacyEncodingConfig: MakeLegacyEncodingConfig(),
stateStore: stateStore,
httpServerStartSignal: make(chan struct{}, 1),
wsServerStartSignal: make(chan struct{}, 1),
BaseApp: bApp,
cdc: cdc,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
keys: keys,
tkeys: tkeys,
memKeys: memKeys,
txDecoder: encodingConfig.TxConfig.TxDecoder(),
versionInfo: version.NewInfo(),
metricCounter: &map[string]float32{},
encodingConfig: encodingConfig,
legacyEncodingConfig: MakeLegacyEncodingConfig(),
stateStore: stateStore,
}

for _, option := range appOptions {
Expand Down Expand Up @@ -1946,17 +1939,6 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req *BlockProcessReq
}
}()

defer func() {
if !app.httpServerStartSignalSent {
app.httpServerStartSignalSent = true
app.httpServerStartSignal <- struct{}{}
}
if !app.wsServerStartSignalSent {
app.wsServerStartSignalSent = true
app.wsServerStartSignal <- struct{}{}
}
}()

ctx = ctx.WithIsOCCEnabled(app.OccEnabled())

blockSpanCtx, blockSpan := app.GetBaseApp().TracingInfo.Start("Block")
Expand Down Expand Up @@ -2640,19 +2622,7 @@ func (app *App) LegacyAmino() *codec.LegacyAmino {
}

func (app *App) GetValidators() []abci.ValidatorUpdate {
// AUTOBAHN: After InitChain but before the first Commit, the committed
// store is empty — staking params don't exist, so reading from committed
// store panics in MaxValidators. Use DeliverContext when available at
// height 0, since it has the uncommitted staking state from InitChain.
// CometBFT consensus never hits this because its handshaker commits
// after InitChain before any block processing begins.
if app.LastBlockHeight() == 0 {
if dctx := app.DeliverContext(); dctx != nil {
return app.StakingKeeper.GetBondedValidators(*dctx)
}
}
ctx := app.NewUncachedContext(false, tmproto.Header{Height: max(app.LastBlockHeight(), 1)})
return app.StakingKeeper.GetBondedValidators(ctx)
return app.StakingKeeper.GetBondedValidators(app.GetCheckCtx())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validators read raced check state

Medium Severity

GetValidators now always reads the bonded set from GetCheckCtx(), including on every Autobahn executeBlock. That shares the mutable check-state multistore with concurrent CheckTx, whereas the old path used an uncached committed context after the first commit.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 809f5a7. Configure here.

}

// AppCodec returns an app codec.
Expand Down Expand Up @@ -2811,7 +2781,7 @@ func (app *App) RegisterLocalServices(node client.LocalClient, txConfig client.T
}
app.evmHTTPServer = evmHTTPServer
go func() {
<-app.httpServerStartSignal
<-app.Initialized()
if err := evmHTTPServer.Start(); err != nil {
panic(err)
}
Expand All @@ -2826,7 +2796,7 @@ func (app *App) RegisterLocalServices(node client.LocalClient, txConfig client.T
}
app.evmWSServer = evmWSServer
go func() {
<-app.wsServerStartSignal
<-app.Initialized()
if err := evmWSServer.Start(); err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions app/eth_replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Replay(a *App) {
if err != nil {
panic(err)
}
_, err = a.InitChain(context.Background(), &abci.RequestInitChain{
_, err = a.InitChain(&abci.RequestInitChain{
Time: time.Now(),
ChainId: gendoc.ChainID,
AppStateBytes: gendoc.AppState,
Expand Down Expand Up @@ -119,7 +119,7 @@ func BlockTest(a *App, bt *ethtests.BlockTest) {
if err != nil {
panic(err)
}
_, err = a.InitChain(context.Background(), &abci.RequestInitChain{
_, err = a.InitChain(&abci.RequestInitChain{
Time: time.Now(),
ChainId: gendoc.ChainID,
AppStateBytes: gendoc.AppState,
Expand Down
75 changes: 34 additions & 41 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,11 @@ func SetupWithAppOptsAndDefaultHome(isCheckTx bool, appOpts TestAppOpts, enableE
// TODO: remove once init chain works with SC
defer func() { _ = recover() }()

_, err = res.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
_, err = res.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
)
if err != nil {
panic(err)
Expand Down Expand Up @@ -466,12 +465,11 @@ func SetupWithDB(tb testing.TB, db dbm.DB, isCheckTx bool, enableEVMCustomPrecom
panic(err)
}

_, err = res.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
_, err = res.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
)
if err != nil {
panic(err)
Expand Down Expand Up @@ -514,12 +512,11 @@ func SetupWithScReceiptFromOpts(t *testing.T, isCheckTx bool, enableEVMCustomPre

defer func() { _ = recover() }()

_, err = res.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
_, err = res.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
)
if err != nil {
panic(err)
Expand Down Expand Up @@ -570,11 +567,10 @@ func SetupWithSc(t *testing.T, isCheckTx bool, enableEVMCustomPrecompiles bool,
// TODO: remove once init chain works with SC
defer func() { _ = recover() }()

_, err = res.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
AppStateBytes: stateBytes,
},
_, err = res.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)
if err != nil {
panic(err)
Expand Down Expand Up @@ -614,12 +610,11 @@ func SetupTestingAppWithLevelDb(t *testing.T, isCheckTx bool, enableEVMCustomPre
panic(err)
}

_, err = app.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
_, err = app.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
)
if err != nil {
panic(err)
Expand Down Expand Up @@ -741,12 +736,11 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
require.NoError(t, err)

// init chain will set the validator set and initialize the genesis accounts
_, _ = app.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
_, _ = app.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
)

// commit genesis changes
Expand Down Expand Up @@ -783,12 +777,11 @@ func SetupWithGenesisAccounts(t *testing.T, genAccs []authtypes.GenesisAccount,
panic(err)
}

_, _ = app.InitChain(
context.Background(), &abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
_, _ = app.InitChain(&abci.RequestInitChain{
ConsensusParams: DefaultConsensusParams,
ChainId: "sei-test",
AppStateBytes: stateBytes,
},
)

_, _ = app.Commit(context.Background())
Expand Down
Binary file removed assets/SeiLogo.png

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this file?

Binary file not shown.
Loading
Loading