Skip to content

Commit 43d9c8c

Browse files
committed
minor cleanup
1 parent 2d2691a commit 43d9c8c

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

core/blockchain.go

-21
Original file line numberDiff line numberDiff line change
@@ -1803,27 +1803,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
18031803
return it.index, err
18041804
}
18051805

1806-
// PreprocessBlock processes block on top of the chain to calculate receipts, bloom and state root
1807-
func (bc *BlockChain) PreprocessBlock(block *types.Block) (common.Hash, types.Bloom, common.Hash, uint64, error) {
1808-
// Retrieve the parent block and it's state to execute on top
1809-
parent := bc.CurrentBlock().Header()
1810-
if parent == nil {
1811-
parent = bc.GetHeader(block.ParentHash(), block.NumberU64()-1)
1812-
}
1813-
statedb, err := state.New(parent.Root, bc.stateCache, bc.snaps)
1814-
if err != nil {
1815-
return common.Hash{}, types.Bloom{}, common.Hash{}, 0, err
1816-
}
1817-
receipts, _, usedGas, err := bc.processor.Process(block, statedb, bc.vmConfig)
1818-
if err != nil {
1819-
return common.Hash{}, types.Bloom{}, common.Hash{}, 0, err
1820-
}
1821-
receiptSha := types.DeriveSha(receipts, trie.NewStackTrie(nil))
1822-
bloom := types.CreateBloom(receipts)
1823-
stateRoot := statedb.GetRootHash()
1824-
return receiptSha, bloom, stateRoot, usedGas, nil
1825-
}
1826-
18271806
func (bc *BlockChain) BuildAndWriteBlock(parentBlock *types.Block, header *types.Header, txs types.Transactions) (WriteStatus, error) {
18281807
if !bc.chainmu.TryLock() {
18291808
return NonStatTy, errInsertionInterrupted

rollup/da_syncer/da/da.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type PartialHeader struct {
4141
Time uint64
4242
BaseFee *big.Int
4343
GasLimit uint64
44-
Difficulty *big.Int
44+
Difficulty uint64
4545
ExtraData []byte
4646
}
4747

@@ -51,7 +51,7 @@ func (h *PartialHeader) ToHeader() *types.Header {
5151
Time: h.Time,
5252
BaseFee: h.BaseFee,
5353
GasLimit: h.GasLimit,
54-
Difficulty: h.Difficulty,
54+
Difficulty: new(big.Int).SetUint64(h.Difficulty),
5555
Extra: h.ExtraData,
5656
}
5757
}

0 commit comments

Comments
 (0)