From 5f2d6961b9d077e47f34bf7f5d1fbffaf380bde1 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 28 Jul 2024 13:26:20 +0800 Subject: [PATCH] feat(taiko-client): introduce `BasefeeSharingPctg` in `BlockMetadata` (#17853) Co-authored-by: maskpp --- go.mod | 2 +- go.sum | 6 ++---- .../driver/chain_syncer/blob/syncer.go | 21 +++++++------------ .../driver/chain_syncer/blob/syncer_test.go | 1 - 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 74a0c8ef15f..6159d49896b 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 128220d31e7..ab089359a85 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/packages/taiko-client/driver/chain_syncer/blob/syncer.go b/packages/taiko-client/driver/chain_syncer/blob/syncer.go index 479012b1814..3b17d758a4a 100644 --- a/packages/taiko-client/driver/chain_syncer/blob/syncer.go +++ b/packages/taiko-client/driver/chain_syncer/blob/syncer.go @@ -272,7 +272,6 @@ func (s *Syncer) onBlockProposed( ctx, meta, parent, - s.state.GetHeadBlockID(), decompressedTxListBytes, &rawdb.L1Origin{ BlockID: meta.GetBlockID(), @@ -313,7 +312,6 @@ func (s *Syncer) insertNewHead( ctx context.Context, meta metadata.TaikoBlockMetaData, parent *types.Header, - headBlockID *big.Int, txListBytes []byte, l1Origin *rawdb.L1Origin, ) (*engine.ExecutableData, error) { @@ -321,7 +319,6 @@ func (s *Syncer) insertNewHead( "Try to insert a new L2 head block", "parentNumber", parent.Number, "parentHash", parent.Hash(), - "headBlockID", headBlockID, "l1Origin", l1Origin, ) @@ -424,7 +421,6 @@ func (s *Syncer) insertNewHead( meta, parent.Hash(), l1Origin, - headBlockID, txListBytes, baseFeeInfo.Basefee, make(types.Withdrawals, 0), @@ -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, @@ -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, @@ -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, diff --git a/packages/taiko-client/driver/chain_syncer/blob/syncer_test.go b/packages/taiko-client/driver/chain_syncer/blob/syncer_test.go index 1eb7cdc2b38..643e7862f17 100644 --- a/packages/taiko-client/driver/chain_syncer/blob/syncer_test.go +++ b/packages/taiko-client/driver/chain_syncer/blob/syncer_test.go @@ -98,7 +98,6 @@ func (s *BlobSyncerTestSuite) TestInsertNewHead() { }, }, parent, - common.Big2, []byte{}, &rawdb.L1Origin{ BlockID: common.Big1,