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

fix(driver): fix GetBasefee parameters #210

Merged
merged 2 commits into from
May 4, 2023
Merged
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
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