aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

Go Ethereum getBlock support. #140

Closed spilin closed 2 years ago

spilin commented 2 years ago

Go Ethereum getBlock call fails for 2 reasons.

  1. Aurora RPC do not support uncle blocks. So though uncles returned is always set to an empty array, sha3Uncles should return keccak256(rlp.encode([])) that always eq to 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347. But instead aurora RPC returns 0x0000000000000000000000000000000000000000000000000000000000000000 which fails validation here raising error 'server returned empty uncle list but block header indicates uncles'.
  2. When block does not have transactions, transactionsRoot should return keccak256(rlp.encode('')), that always eq to 56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421. Instead Aurora RPC returns 0x1223349a40d2ee10bd1bebb5889ef8018c8bc13359ed94b387810af96c6e4268 , 0x0000000000000000000000000000000000000000000000000000000000000000 or other hash. This causes this validation to fail with message server returned empty transaction list but block header indicates transactions

Steps to reproduce:

package main

import (
    "context"
    "fmt"
    "math/big"
    "github.com/ethereum/go-ethereum/ethclient"
)

func main() {
    rpc := "https://testnet.aurora.dev"
    client, err := ethclient.Dial(rpc)
    if err != nil {
        panic(err)
    }

    block, err := client.BlockByNumber(context.Background(), big.NewInt(int64(74056620)))
    if err != nil {
        panic(err)
    }
    fmt.Printf("Block info %+v\n", block)
}