Skip to content

Commit ed61edb

Browse files
committed
nit
1 parent cc27ba3 commit ed61edb

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

cmd/evm/internal/t8ntool/execution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
150150
}
151151
// Apply Scroll hard fork state transitions on state
152152
misc.ApplyForkStateTransitions(chainConfig, statedb, pre.Env.Number, pre.Env.Timestamp, pre.Env.ParentTimestamp)
153-
// Apply EIP-2935
153+
// Apply EIP-2935: Insert parent hash in history contract.
154154
if pre.Env.BlockHashes != nil && chainConfig.IsFeynman(pre.Env.Timestamp) {
155155
var (
156156
prevNumber = pre.Env.Number - 1

consensus/misc/curie.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
88
)
99

10-
// ApplyCurieHardFork modifies the state database according to the Curie hard-fork rules,
10+
// applyCurieHardFork modifies the state database according to the Curie hard-fork rules,
1111
// updating the bytecode and storage of the L1GasPriceOracle contract.
12-
func ApplyCurieHardFork(statedb *state.StateDB) {
12+
func applyCurieHardFork(statedb *state.StateDB) {
1313
log.Info("Applying Curie hard fork")
1414

1515
// update contract byte code

consensus/misc/feynman.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
88
)
99

10-
// ApplyFeynmanHardFork modifies the state database according to the Feynman hard-fork rules,
10+
// applyFeynmanHardFork modifies the state database according to the Feynman hard-fork rules,
1111
// updating the bytecode and storage of the L1GasPriceOracle contract.
12-
func ApplyFeynmanHardFork(statedb *state.StateDB) {
12+
func applyFeynmanHardFork(statedb *state.StateDB) {
1313
log.Info("Applying Feynman hard fork")
1414

1515
// update contract byte code

consensus/misc/forks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ func VerifyForkHashes(config *params.ChainConfig, header *types.Header, uncle bo
4949
func ApplyForkStateTransitions(config *params.ChainConfig, statedb *state.StateDB, blockNumber, blockTimestamp, parentTimestamp uint64) {
5050
// Apply Curie hard fork
5151
if config.CurieBlock != nil && config.CurieBlock.Cmp(new(big.Int).SetUint64(blockNumber)) == 0 {
52-
ApplyCurieHardFork(statedb)
52+
applyCurieHardFork(statedb)
5353
}
5454
// Apply Feynman hard fork
5555
if config.IsFeynmanTransitionBlock(blockTimestamp, parentTimestamp) {
56-
ApplyFeynmanHardFork(statedb)
56+
applyFeynmanHardFork(statedb)
5757
}
5858
// Apply GalileoV2 hard fork
5959
if config.IsGalileoV2TransitionBlock(blockTimestamp, parentTimestamp) {
60-
ApplyGalileoV2HardFork(statedb)
60+
applyGalileoV2HardFork(statedb)
6161
}
6262
}

consensus/misc/galileoV2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
88
)
99

10-
// ApplyGalileoV2HardFork modifies the state database according to the GalileoV2 hard-fork rules,
10+
// applyGalileoV2HardFork modifies the state database according to the GalileoV2 hard-fork rules,
1111
// updating the bytecode and storage of the L1GasPriceOracle contract.
12-
func ApplyGalileoV2HardFork(statedb *state.StateDB) {
12+
func applyGalileoV2HardFork(statedb *state.StateDB) {
1313
log.Info("Applying GalileoV2 hard fork")
1414

1515
// update contract byte code

core/chain_makers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
247247
misc.ApplyDAOHardFork(statedb)
248248
}
249249
// Apply Scroll hard fork state transitions on state
250-
misc.ApplyForkStateTransitions(config, statedb, b.header.Number.Uint64(), b.header.Time, parent.Time())
250+
misc.ApplyForkStateTransitions(config, statedb, b.header.Number.Uint64(), b.Time(), parent.Time())
251251
// Execute any user modifications to the block
252252
if gen != nil {
253253
gen(i, b)

core/state_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
9191
// Apply Scroll hard fork state transitions on state
9292
parent := p.bc.GetHeaderByHash(block.ParentHash())
9393
misc.ApplyForkStateTransitions(p.config, statedb, blockNumber.Uint64(), blockTime, parent.Time)
94-
// Apply EIP-2935
94+
// Apply EIP-2935: Insert parent hash in history contract.
9595
blockContext := NewEVMBlockContext(header, p.bc, p.config, nil)
9696
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, cfg)
9797
processorBlockTransactionGauge.Update(int64(block.Transactions().Len()))

eth/state_accessor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (eth *Ethereum) stateAtTransaction(block *types.Block, txIndex int, reexec
179179
}
180180
// Apply Scroll hard fork state transitions on state
181181
misc.ApplyForkStateTransitions(eth.blockchain.Config(), statedb, block.NumberU64(), block.Time(), parent.Time())
182-
// If feynman hardfork, insert parent block hash in the state as per EIP-2935.
182+
// Apply EIP-2935: Insert parent hash in history contract.
183183
if eth.blockchain.Config().IsFeynman(block.Time()) {
184184
context := core.NewEVMBlockContext(block.Header(), eth.blockchain, eth.blockchain.Config(), nil)
185185
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, eth.blockchain.Config(), vm.Config{})

eth/tracers/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ type txTraceResult struct {
205205
type blockTraceTask struct {
206206
statedb *state.StateDB // Intermediate state prepped for tracing
207207
block *types.Block // Block to trace the transactions from
208-
parentBlock *types.Block // Block to trace the transactions from
208+
parentBlock *types.Block // Parent block of the block to trace
209209
rootref common.Hash // Trie root reference held for this task
210210
results []*txTraceResult // Trace results procudes by the task
211211
}
@@ -283,7 +283,7 @@ func (api *API) traceChain(ctx context.Context, start, end *types.Block, config
283283
// Apply Scroll hard fork state transitions on state
284284
misc.ApplyForkStateTransitions(api.backend.ChainConfig(), task.statedb, task.block.NumberU64(), task.block.Time(), task.parentBlock.Time())
285285

286-
// EIP-2935: Insert parent hash in history contract.
286+
// Apply EIP-2935: Insert parent hash in history contract.
287287
if api.backend.ChainConfig().IsFeynman(task.block.Time()) {
288288
evm := vm.NewEVM(blockCtx, vm.TxContext{}, task.statedb, api.backend.ChainConfig(), vm.Config{})
289289
core.ProcessParentBlockHash(task.block.ParentHash(), evm, task.statedb)
@@ -555,7 +555,7 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config
555555
// Apply Scroll hard fork state transitions on state
556556
misc.ApplyForkStateTransitions(api.backend.ChainConfig(), statedb, block.NumberU64(), block.Time(), parent.Time())
557557

558-
// EIP-2935: Insert parent hash in history contract.
558+
// Apply EIP-2935: Insert parent hash in history contract.
559559
if api.backend.ChainConfig().IsFeynman(block.Time()) {
560560
vmenv := vm.NewEVM(vmctx, vm.TxContext{}, statedb, chainConfig, vm.Config{})
561561
core.ProcessParentBlockHash(block.ParentHash(), vmenv, statedb)
@@ -639,7 +639,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
639639
// Apply Scroll hard fork state transitions on state
640640
misc.ApplyForkStateTransitions(api.backend.ChainConfig(), statedb, block.NumberU64(), block.Time(), parent.Time())
641641

642-
// EIP-2935: Insert parent hash in history contract.
642+
// Apply EIP-2935: Insert parent hash in history contract.
643643
if api.backend.ChainConfig().IsFeynman(block.Time()) {
644644
evm := vm.NewEVM(blockCtx, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
645645
core.ProcessParentBlockHash(block.ParentHash(), evm, statedb)
@@ -783,7 +783,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
783783
// Apply Scroll hard fork state transitions on state
784784
misc.ApplyForkStateTransitions(api.backend.ChainConfig(), statedb, block.NumberU64(), block.Time(), parent.Time())
785785

786-
// EIP-2935: Insert parent hash in history contract.
786+
// Apply EIP-2935: Insert parent hash in history contract.
787787
if api.backend.ChainConfig().IsFeynman(block.Time()) {
788788
evm := vm.NewEVM(vmctx, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
789789
core.ProcessParentBlockHash(block.ParentHash(), evm, statedb)

miner/scroll_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ func (w *worker) handleForks(parent *types.Block) (bool, error) {
633633
// Apply Scroll hard fork state transitions on state
634634
misc.ApplyForkStateTransitions(w.chainConfig, w.current.state, w.current.header.Number.Uint64(), w.current.header.Time, parent.Time())
635635

636-
// Apply EIP-2935
636+
// Apply EIP-2935: Insert parent hash in history contract.
637637
if w.chainConfig.IsFeynman(w.current.header.Time) {
638638
context := core.NewEVMBlockContext(w.current.header, w.chain, w.chainConfig, nil)
639639
vmenv := vm.NewEVM(context, vm.TxContext{}, w.current.state, w.chainConfig, vm.Config{})

0 commit comments

Comments
 (0)