Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
fix(driver): fix GetBasefee parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed May 4, 2023
1 parent 2340210 commit 9c4e512
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
02552f2aa001893d326062ce627004c61b46cd26
801162c90fd751ae88cd87ae90b36076f7b635e8
11 changes: 8 additions & 3 deletions driver/chain_syncer/calldata/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,15 @@ func (s *Syncer) insertNewHead(
}
}

parentTimestamp, err := s.rpc.TaikoL2.ParentTimestamp(&bind.CallOpts{BlockNumber: parent.Number})
if err != nil {
return nil, nil, err
}

// Get L2 baseFee
baseFee, err := s.rpc.TaikoL2.GetBasefee(
&bind.CallOpts{Pending: true},
uint32(event.Meta.Timestamp-parent.Time),
&bind.CallOpts{BlockNumber: parent.Number},
uint32(event.Meta.Timestamp-parentTimestamp),
uint64(event.Meta.GasLimit+uint32(s.anchorConstructor.GasLimit())),
parent.GasUsed,
)
Expand All @@ -264,7 +269,7 @@ func (s *Syncer) insertNewHead(
log.Debug(
"GetBasefee",
"baseFee", baseFee,
"timeSinceParent", uint32(event.Meta.Timestamp-parent.Time),
"timeSinceParent", uint32(event.Meta.Timestamp-parentTimestamp),
"gasLimit", uint64(event.Meta.GasLimit+uint32(s.anchorConstructor.GasLimit())),
"parentGasUsed", parent.GasUsed,
)
Expand Down

0 comments on commit 9c4e512

Please sign in to comment.