Open
Description
System information
chain : mekong
node : nethermind:pectra_devnet_4-c3827bc
problem
codebase using go-ethereum 1.15.2 returns different tx hash when I do
curl -s -X 'POST' \
'mekong-rpc' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"method":"eth_getBlockByNumber","params":["723966"],"id":1,"jsonrpc":"2.0"}' | jq
it returns a block that include 101 transactions.
"number": "0xb0bfe",
"transactions": [
"0x7b0fab2f34f386af1807d88148d0e34338b083f8169ecab189b45f5577526db6",
"0xa07a03c2a99b7a1c39f4d5e446ec2819745729bb4857e93c56b863021f3c62f4",
"0xf07848b136d89dbf28ed9117c53e83b09609b48ca349f583a74b4f90144bd673",
...
- first transaction(0x7b0fab2f34f386af1807d88148d0e34338b083f8169ecab189b45f5577526db6) is a different hash when I execute the following code.
- first transaction type is
SetCodeTxType = 0x04
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
defer cancel()
rpcClient, err := rpc.Dial(endpoint)
if err != nil {
return nil, err
}
nativeClient, err := ethclient.Dial(endpoint)
if err != nil {
return nil, err
}
block, err := nativeClient.BlockByNumber(ctx, big.NewInt(int64(723966)))
if err != nil {
return nil, err
}
for I, tx := range block.Transactions() {
fmt.Println(i, tx.Hash())
}
tx.Hash() returns
0 0x5aa77e1c25351125de796fdb2cf2638162304204a5f0a26a4f254635aadc35fb
1 0xa07a03c2a99b7a1c39f4d5e446ec2819745729bb4857e93c56b863021f3c62f4
2 0xf07848b136d89dbf28ed9117c53e83b09609b48ca349f583a74b4f90144bd673
...
comparison ( node vs go-ethereum v1.15.2 )
`0x7b0fab2f34f386af1807d88148d0e34338b083f8169ecab189b45f5577526db6`(nethermind client) and `0x5aa77e1c25351125de796fdb2cf2638162304204a5f0a26a4f254635aadc35fb`(go-ethereum 1.15.2)
So it didn't return a transaction in a block.
hash := common.Hash{}
hb, _ := hexutil.Decode("0x5aa77e1c25351125de796fdb2cf2638162304204a5f0a26a4f254635aadc35fb")
copy(hash[:], hb)
tx, _, _ := nativeClient.TransactionByHash(context.Background(), hash)
fmt.Println("0x5aa77e1c25351125de796fdb2cf2638162304204a5f0a26a4f254635aadc35fb", "not found", tx)
> returns
0x5aa77e1c25351125de796fdb2cf2638162304204a5f0a26a4f254635aadc35fb notfound <nil>
also following returns a transaction receipt in a block
hash := common.Hash{}
hb, _ := hexutil.Decode("0x7b0fab2f34f386af1807d88148d0e34338b083f8169ecab189b45f5577526db6")
copy(hash[:], hb)
tx, _, _ = nativeClient.TransactionByHash(context.Background(), hash)
fmt.Println("0x7b0fab2f34f386af1807d88148d0e34338b083f8169ecab189b45f5577526db6", "found", tx)
> returns
0x7b0fab2f34f386af1807d88148d0e34338b083f8169ecab189b45f5577526db6 found &{0x14000324b00 {13971912356928464712 1224880167 0x102c12d60} {[] {} <nil>} {{} {} 0} {[] {} 0x1400038a900}}
Activity