Skip to content

Commit

Permalink
feat(taiko-client): introduce BasefeeSharingPctg in BlockMetadata (
Browse files Browse the repository at this point in the history
…#17853)

Co-authored-by: maskpp <maskpp266@gmail.com>
  • Loading branch information
davidtaikocha and mask-pp authored Jul 28, 2024
1 parent 26f4a2f commit 5f2d696
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/ethereum/go-ethereum v1.13.15 => github.com/taikoxyz/taiko-geth v0.0.0-20240504072040-7e1b8b65a3f8
replace github.com/ethereum/go-ethereum v1.13.15 => github.com/taikoxyz/taiko-geth v1.5.1-0.20240726090203-e6487f00ed74

replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/optimism v0.0.0-20240627102435-4845247ff00c

Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1165,12 +1165,10 @@ github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/taikoxyz/optimism v0.0.0-20240624055706-43346f17fbdb h1:t4JcXSwxpUIYq5HrIYCkIfRBc/cytoC6X4YjeJF+qck=
github.com/taikoxyz/optimism v0.0.0-20240624055706-43346f17fbdb/go.mod h1:jKn73pLX8eDIG0Y3XeuUSetepecM8OvRflyPHbi05B4=
github.com/taikoxyz/optimism v0.0.0-20240627102435-4845247ff00c h1:Hfhh/icxShwpLdX7RqYzZN1EU40MGWhvSXc2V+ZzTxw=
github.com/taikoxyz/optimism v0.0.0-20240627102435-4845247ff00c/go.mod h1:jKn73pLX8eDIG0Y3XeuUSetepecM8OvRflyPHbi05B4=
github.com/taikoxyz/taiko-geth v0.0.0-20240504072040-7e1b8b65a3f8 h1:z4juQ4Nyp2T836JTCNC8t3vrbr0K9v2pPUV/ir2dy9s=
github.com/taikoxyz/taiko-geth v0.0.0-20240504072040-7e1b8b65a3f8/go.mod h1:nqByouVW0a0qx5KKgvYgoXba+pYEHznAAQp6LhZilgM=
github.com/taikoxyz/taiko-geth v1.5.1-0.20240726090203-e6487f00ed74 h1:b0vfUA4EPp4SoVbO3xIXjK/llIM+CQcvczpoJ/idvi4=
github.com/taikoxyz/taiko-geth v1.5.1-0.20240726090203-e6487f00ed74/go.mod h1:nqByouVW0a0qx5KKgvYgoXba+pYEHznAAQp6LhZilgM=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU=
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4=
Expand Down
21 changes: 8 additions & 13 deletions packages/taiko-client/driver/chain_syncer/blob/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ func (s *Syncer) onBlockProposed(
ctx,
meta,
parent,
s.state.GetHeadBlockID(),
decompressedTxListBytes,
&rawdb.L1Origin{
BlockID: meta.GetBlockID(),
Expand Down Expand Up @@ -313,15 +312,13 @@ func (s *Syncer) insertNewHead(
ctx context.Context,
meta metadata.TaikoBlockMetaData,
parent *types.Header,
headBlockID *big.Int,
txListBytes []byte,
l1Origin *rawdb.L1Origin,
) (*engine.ExecutableData, error) {
log.Debug(
"Try to insert a new L2 head block",
"parentNumber", parent.Number,
"parentHash", parent.Hash(),
"headBlockID", headBlockID,
"l1Origin", l1Origin,
)

Expand Down Expand Up @@ -424,7 +421,6 @@ func (s *Syncer) insertNewHead(
meta,
parent.Hash(),
l1Origin,
headBlockID,
txListBytes,
baseFeeInfo.Basefee,
make(types.Withdrawals, 0),
Expand Down Expand Up @@ -458,7 +454,6 @@ func (s *Syncer) createExecutionPayloads(
meta metadata.TaikoBlockMetaData,
parentHash common.Hash,
l1Origin *rawdb.L1Origin,
headBlockID *big.Int,
txListBytes []byte,
baseFee *big.Int,
withdrawals types.Withdrawals,
Expand All @@ -470,13 +465,13 @@ func (s *Syncer) createExecutionPayloads(
SuggestedFeeRecipient: meta.GetCoinbase(),
Withdrawals: withdrawals,
BlockMetadata: &engine.BlockMetadata{
HighestBlockID: headBlockID,
Beneficiary: meta.GetCoinbase(),
GasLimit: uint64(meta.GetGasLimit()) + consensus.AnchorGasLimit,
Timestamp: meta.GetTimestamp(),
TxList: txListBytes,
MixHash: meta.GetDifficulty(),
ExtraData: meta.GetExtraData(),
Beneficiary: meta.GetCoinbase(),
GasLimit: uint64(meta.GetGasLimit()) + consensus.AnchorGasLimit,
Timestamp: meta.GetTimestamp(),
TxList: txListBytes,
MixHash: meta.GetDifficulty(),
ExtraData: meta.GetExtraData(),
BasefeeSharingPctg: meta.GetBasefeeSharingPctg(),
},
BaseFeePerGas: baseFee,
L1Origin: l1Origin,
Expand All @@ -489,7 +484,7 @@ func (s *Syncer) createExecutionPayloads(
"random", attributes.Random,
"suggestedFeeRecipient", attributes.SuggestedFeeRecipient,
"withdrawals", len(attributes.Withdrawals),
"highestBlockID", attributes.BlockMetadata.HighestBlockID,
"basefeeSharingPctg", attributes.BlockMetadata.BasefeeSharingPctg,
"gasLimit", attributes.BlockMetadata.GasLimit,
"timestamp", attributes.BlockMetadata.Timestamp,
"mixHash", attributes.BlockMetadata.MixHash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func (s *BlobSyncerTestSuite) TestInsertNewHead() {
},
},
parent,
common.Big2,
[]byte{},
&rawdb.L1Origin{
BlockID: common.Big1,
Expand Down

0 comments on commit 5f2d696

Please sign in to comment.