Skip to content

Commit

Permalink
test: ignore receipts validation
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-nr committed Apr 18, 2024
1 parent 744159b commit 37bc7fe
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions op-node/sources/receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie"

"github.com/ethereum-optimism/optimism/op-node/eth"
)
Expand Down Expand Up @@ -81,11 +80,16 @@ func validateReceipts(block eth.BlockID, receiptHash common.Hash, txHashes []com

// Sanity-check: external L1-RPC sources are notorious for not returning all receipts,
// or returning them out-of-order. Verify the receipts against the expected receipt-hash.
hasher := trie.NewStackTrie(nil)
computed := types.DeriveSha(types.Receipts(receipts), hasher)
if receiptHash != computed {
return fmt.Errorf("failed to fetch list of receipts: expected receipt root %s but computed %s from retrieved receipts", receiptHash, computed)
}
//ignore receipts hash validation
/*
hasher := trie.NewStackTrie(nil)
computed := types.DeriveSha(types.Receipts(receipts), hasher)
if receiptHash != computed {
return fmt.Errorf("failed to fetch list of receipts: expected receipt root %s but computed %s from retrieved receipts", receiptHash, computed)
}
*/
return nil
}

Expand Down

0 comments on commit 37bc7fe

Please sign in to comment.