Skip to content

Commit

Permalink
fix(op-e2e): fallback to not use bsc specific method eth_getFinalized…
Browse files Browse the repository at this point in the history
…Block (#64)

* fix(op-e2e): fallback to not use bsc specific method eth_getFinalizedBlock in e2e-test

* catch error msg: eth_getFinalizedBlock does not exist
  • Loading branch information
bnoieh authored Oct 13, 2023
1 parent 5bbdb8b commit f7352ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions op-node/sources/l1_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func NewL1Client(client client.RPC, log log.Logger, metrics caching.Metrics, con
// Notice, we cannot cache a block reference by label because labels are not guaranteed to be unique.
func (s *L1Client) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error) {
info, err := s.BSCInfoByLabel(ctx, label)
if label == eth.Finalized && err != nil && strings.Contains(err.Error(), "eth_getFinalizedBlock does not exist") {
// op-e2e not support bsc as L1 currently, so fallback to not use bsc specific method eth_getFinalizedBlock
info, err = s.InfoByLabel(ctx, label)
}
if err != nil {
// Both geth and erigon like to serve non-standard errors for the safe and finalized heads, correct that.
// This happens when the chain just started and nothing is marked as safe/finalized yet.
Expand Down

0 comments on commit f7352ab

Please sign in to comment.