Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions op-service/sources/eth_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,14 @@ func (s *EthClient) GetStorageAt(ctx context.Context, address common.Address, st
// ReadStorageAt is a convenience method to read a single storage value at the given slot in the given account.
// The storage slot value is verified against the state-root of the given block if we do not trust the RPC provider, or directly retrieved without proof if we do trust the RPC.
func (s *EthClient) ReadStorageAt(ctx context.Context, address common.Address, storageSlot common.Hash, blockHash common.Hash) (common.Hash, error) {
chainId, err := s.ChainID(ctx)
if err != nil {
return common.Hash{}, fmt.Errorf("failed to fetch chain id: %w", err)
}
// BSC Testnet doesn't support fetching the storage based on block hash
if chainId.Cmp(big.NewInt(97)) == 0 {
return s.GetStorageAt(ctx, address, storageSlot, "latest")
}
if s.trustRPC {
return s.GetStorageAt(ctx, address, storageSlot, blockHash.String())
}
Expand Down
6 changes: 6 additions & 0 deletions op-service/sources/receipts_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ func (f *RPCReceiptsFetcher) FetchReceipts(ctx context.Context, blockInfo eth.Bl
return nil, err
}

// This is a special case for BNB Testnet, where the receipt hash is not deterministic.
// We skip the validation for this block.
if blockInfo.ReceiptHash() == common.HexToHash("0xccc2eafe27c3dbcd0ad60a40f599fbc67a5e2dfbfdfbcce7e2455688870e7ec2") {
return
}

if err = validateReceipts(block, blockInfo.ReceiptHash(), txHashes, result); err != nil {
return nil, err
}
Expand Down