|
6 | 6 | "github.com/erigontech/erigon-lib/chain" |
7 | 7 | "github.com/erigontech/erigon-lib/kv" |
8 | 8 | "github.com/erigontech/erigon-lib/log/v3" |
9 | | - "github.com/erigontech/erigon-lib/opstack" |
10 | 9 | "github.com/erigontech/erigon/consensus" |
11 | 10 | "github.com/erigontech/erigon/core/types" |
12 | 11 | "github.com/erigontech/erigon/turbo/builder" |
@@ -52,17 +51,6 @@ func SpawnMiningFinishStage(s *StageState, tx kv.RwTx, cfg MiningFinishCfg, quit |
52 | 51 | // continue |
53 | 52 | //} |
54 | 53 |
|
55 | | - // Store DA footprint in BlobGasUsed header field if it hasn't already been set yet. |
56 | | - // Builder code may already calculate it during block building to avoid recalculating it here. |
57 | | - header := current.Header |
58 | | - if cfg.chainConfig.IsJovian(header.Time) && (header.BlobGasUsed == nil || *header.BlobGasUsed == 0) { |
59 | | - daFootprint, err := CalcDAFootprint(current.Txs) |
60 | | - if err != nil { |
61 | | - return fmt.Errorf("error calculating DA footprint: %w", err) |
62 | | - } |
63 | | - header.BlobGasUsed = &daFootprint |
64 | | - } |
65 | | - |
66 | 54 | block := types.NewBlockForAsembling(current.Header, current.Txs, current.Uncles, current.Receipts, current.Withdrawals, cfg.chainConfig.IsOptimismIsthmus(current.Header.Time)) |
67 | 55 | blockWithReceipts := &types.BlockWithReceipts{Block: block, Receipts: current.Receipts, Requests: current.Requests} |
68 | 56 | *current = MiningBlock{} // hack to clean global data |
@@ -109,37 +97,3 @@ func SpawnMiningFinishStage(s *StageState, tx kv.RwTx, cfg MiningFinishCfg, quit |
109 | 97 |
|
110 | 98 | return nil |
111 | 99 | } |
112 | | - |
113 | | -// CalcDAFootprint calculates the total DA footprint of a block for an OP Stack chain. |
114 | | -// Jovian introduces a DA footprint block limit which is stored in the BlobGasUsed header field and that is taken |
115 | | -// into account during base fee updates. |
116 | | -// CalcDAFootprint must not be called for pre-Jovian blocks. |
117 | | -func CalcDAFootprint(txs types.Transactions) (uint64, error) { |
118 | | - if txs.Len() == 0 || txs[0].Type() != types.DepositTxType { |
119 | | - return 0, fmt.Errorf("missing deposit transaction") |
120 | | - } |
121 | | - |
122 | | - // First Jovian block doesn't set the DA footprint gas scalar yet and |
123 | | - // it must not have user transactions. |
124 | | - data := txs[0].GetData() |
125 | | - if len(data) == opstack.IsthmusL1AttributesLen { |
126 | | - if txs[len(txs)-1].Type() != types.DepositTxType { |
127 | | - // sufficient to check last transaction because deposits precede non-deposit txs |
128 | | - return 0, fmt.Errorf("unexpected non-deposit transactions in Jovian activation block") |
129 | | - } |
130 | | - return 0, nil |
131 | | - } // ExtractDAFootprintGasScalar catches all invalid lengths |
132 | | - |
133 | | - daFootprintGasScalar, err := opstack.ExtractDAFootprintGasScalar(data) |
134 | | - if err != nil { |
135 | | - return 0, err |
136 | | - } |
137 | | - var daFootprint uint64 |
138 | | - for _, tx := range txs { |
139 | | - if tx.Type() == types.DepositTxType { |
140 | | - continue |
141 | | - } |
142 | | - daFootprint += tx.RollupCostData().EstimatedDASize().Uint64() * uint64(daFootprintGasScalar) |
143 | | - } |
144 | | - return daFootprint, nil |
145 | | -} |
0 commit comments