Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(op-e2e): fallback to not use bsc specific method eth_getFinalizedBlock #64

Merged
merged 2 commits into from
Oct 13, 2023
Merged
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
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
Loading