Commit dd4dce86 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #4822 from mdehoog/fix-proof

[op-node] Fix ReadStorageAt for 0-prefixed values
parents 56efac5b 5f203dee
......@@ -15,7 +15,7 @@ import (
type StorageProofEntry struct {
Key common.Hash `json:"key"`
Value hexutil.Bytes `json:"value"`
Value hexutil.Big `json:"value"`
Proof []hexutil.Bytes `json:"proof"`
}
......
......@@ -359,7 +359,8 @@ func (s *EthClient) ReadStorageAt(ctx context.Context, address common.Address, s
if err := result.Verify(block.Root()); err != nil {
return common.Hash{}, fmt.Errorf("failed to verify retrieved proof against state root: %w", err)
}
return common.BytesToHash(result.StorageProof[0].Value), nil
value := result.StorageProof[0].Value.ToInt()
return common.BytesToHash(value.Bytes()), nil
}
func (s *EthClient) Close() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment