diff --git a/go.mod b/go.mod index 09600491ca..32e013e6e2 100644 --- a/go.mod +++ b/go.mod @@ -275,8 +275,8 @@ replace ( cosmossdk.io/store => github.com/InjectiveLabs/cosmos-sdk/store v0.0.0-20240904140803-b4127ecb5410 cosmossdk.io/x/tx => github.com/InjectiveLabs/cosmos-sdk/x/tx v0.0.0-20240904140803-b4127ecb5410 - github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-3 - github.com/cosmos/cosmos-sdk => github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241009150651-2a2420946b5a + github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-4 + github.com/cosmos/cosmos-sdk => github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241010141128-de2b5199b23e github.com/ethereum/go-ethereum => github.com/InjectiveLabs/go-ethereum v1.9.22-0.20240923100242-5e28e23d353e nhooyr.io/websocket => github.com/coder/websocket v1.8.10 // replaced as instructed here:https://coder.com/blog/websocket ) diff --git a/go.sum b/go.sum index fd535b7e28..0c3e7a7900 100644 --- a/go.sum +++ b/go.sum @@ -238,10 +238,10 @@ github.com/DataDog/sketches-go v1.4.2 h1:gppNudE9d19cQ98RYABOetxIhpTCl4m7CnbRZjv github.com/DataDog/sketches-go v1.4.2/go.mod h1:xJIXldczJyyjnbDop7ZZcLxJdV3+7Kra7H1KMgpgkLk= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/InjectiveLabs/cometbft v0.38.11-inj-3 h1:82i3DrztJxVs1R45wVTUKZ5+8g+HT5KPexu6mB92jaE= -github.com/InjectiveLabs/cometbft v0.38.11-inj-3/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= -github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241009150651-2a2420946b5a h1:MnASvPFfkvCBN7UQrmGyD101lJHubbE96gLwZ6TQlWs= -github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241009150651-2a2420946b5a/go.mod h1:VoDw+J+Xx6cQz/VUbXLXwQNm9S75a8zWAvKrXDqD3u4= +github.com/InjectiveLabs/cometbft v0.38.11-inj-4 h1:WBL3gGcPEYscqpIH+r1IkytmMhoLt247JtO71AlZ/iQ= +github.com/InjectiveLabs/cometbft v0.38.11-inj-4/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= +github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241010141128-de2b5199b23e h1:fFy5HkvhhCcNsnkwM2pJf7+TiIWs6nOgCct6FLMI9i4= +github.com/InjectiveLabs/cosmos-sdk v0.50.10-0.20241010141128-de2b5199b23e/go.mod h1:DAbn+xjBNvDKXf/XThMI/UADLyJi55Jo+ILfJ0NE4tQ= github.com/InjectiveLabs/cosmos-sdk/client/v2 v2.0.0-20240904140803-b4127ecb5410 h1:gUiyEHPKz+S1vOb3DhVSpUvSreUR7Z/8Hv3OXws/7LA= github.com/InjectiveLabs/cosmos-sdk/client/v2 v2.0.0-20240904140803-b4127ecb5410/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= github.com/InjectiveLabs/cosmos-sdk/store v0.0.0-20240904140803-b4127ecb5410 h1:6ai8wHEoV48EACjoGpqW8uxuwCcZfYMBU7FEoC0R0lI= diff --git a/x/evm/tracers/firehose.go b/x/evm/tracers/firehose.go index 00fd1983cf..148de47a00 100644 --- a/x/evm/tracers/firehose.go +++ b/x/evm/tracers/firehose.go @@ -418,6 +418,8 @@ func (f *Firehose) OnCosmosBlockStart(event cosmostracing.CosmosStartBlockEvent) gasLimit := event.GasLimit baseFee := event.BaseFee + // The block version seems to be 11 on each block, is there a way to get it? + header.Version.Block = 11 f.cosmosBlockHeader = header firehoseInfo("block start (number=%d)", header.Height) @@ -1670,6 +1672,11 @@ func newBlockHeaderFromChainHeader(h *types.Header, td *pbeth.BigInt) *pbeth.Blo func newBlockHeaderFromCosmosChainHeader(h *cosmostypes.Header, coinbase []byte, gasLimit uint64, baseFee *big.Int) *pbeth.BlockHeader { difficulty := firehoseBigIntFromNative(new(big.Int).SetInt64(0)) + parentBlockHash := h.LastBlockID.Hash + if h.Height == 1 { + parentBlockHash = common.Hash{}.Bytes() + } + transactionRoot := types.EmptyRootHash.Bytes() if h.DataHash != nil { transactionRoot = h.DataHash @@ -1678,7 +1685,7 @@ func newBlockHeaderFromCosmosChainHeader(h *cosmostypes.Header, coinbase []byte, // the hash is calculated by the end block as we are missing some data // same applies with the parent hash pbHead := &pbeth.BlockHeader{ - ParentHash: h.LastBlockID.Hash, + ParentHash: parentBlockHash, Number: uint64(h.Height), UncleHash: types.EmptyUncleHash.Bytes(), // No uncles in Tendermint Coinbase: coinbase,