Skip to content

Commit 81c4558

Browse files
puneet2019claude
andcommitted
fix(rpc): emit canonical block hash in newHeads subscription
Signed-off-by: puneetmahajan <59960662+puneet2019@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4ab7ba4 commit 81c4558

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
### BUG FIXES
3636

37+
- [\#1214](https://github.com/cosmos/evm/pull/1214) Emit the canonical CometBFT block hash in the `newHeads` subscription so it matches `eth_getBlockByNumber` (completes [\#725](https://github.com/cosmos/evm/pull/725)).
3738
- [\#1047](https://github.com/cosmos/evm/pull/1047) Resolve EthTxIndex -1 sentinel before uint cast in ReceiptsFromCometBlock, preventing transactionIndex overflow to MaxUint64.
3839
- [\#965](https://github.com/cosmos/evm/pull/965) Fix gas double charging on EVM calls in IBCOnTimeoutPacketCallback.
3940
- [\#869](https://github.com/cosmos/evm/pull/869) Fix erc20 IBC callbacks to check for native token transfer before parsing recipient.

rpc/websockets.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
rpcfilters "github.com/cosmos/evm/rpc/namespaces/ethereum/eth/filters"
2727
"github.com/cosmos/evm/rpc/stream"
28+
rpctypes "github.com/cosmos/evm/rpc/types"
2829
"github.com/cosmos/evm/server/config"
2930

3031
"cosmossdk.io/log/v2"
@@ -463,7 +464,7 @@ func (api *pubSubAPI) subscribeNewHeads(wsConn *wsConn, subID rpc.ID) (context.C
463464
Method: "eth_subscription",
464465
Params: &SubscriptionResult{
465466
Subscription: subID,
466-
Result: header.EthHeader,
467+
Result: rpctypes.RPCMarshalHeader(header.EthHeader, header.Hash.Bytes()),
467468
},
468469
}
469470

0 commit comments

Comments
 (0)