Fantom-foundation / Norma

Integration project of Carmen and Tosca
GNU Lesser General Public License v3.0
2 stars 9 forks source link

Verify that block hash consistency is checked at end of each scenario run #271

Closed HerbertJordan closed 2 weeks ago

kjezek commented 2 weeks ago

This check is still present in recent version and it is executed:

https://github.com/Fantom-foundation/Norma/blob/main/driver/norma/run.go#L227-L236

image image
kjezek commented 2 weeks ago

Following properties are checked:


type blockHashes struct {
    Hash         common.Hash
    StateRoot    common.Hash
    ReceiptsRoot common.Hash
}

func getBlockHashes(rpcClient rpc.RpcClient, blockNumber uint64) (*blockHashes, error) {
    var block *blockHashes
    err := rpcClient.Call(&block, "eth_getBlockByNumber", hexutil.EncodeUint64(blockNumber), false)
    if err != nil {
        return nil, fmt.Errorf("failed to get block state root from RPC; %v", err)
    }
    return block, nil
}