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 (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed May 4, 2023
1 parent 2340210 commit b5dc5c5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
with:
repository: taikoxyz/taiko-mono
path: ${{ env.TAIKO_MONO_DIR }}
ref: get_oracle_prover

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
02552f2aa001893d326062ce627004c61b46cd26
b27d42cc59e26a8ff451692febfc4d1d71da66db
58 changes: 45 additions & 13 deletions bindings/gen_taiko_l1.go

Large diffs are not rendered by default.

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 b5dc5c5

Please sign in to comment.