@@ -464,8 +464,7 @@ func (w *worker) collectPendingL1Messages(startIndex uint64) []types.L1MessageTx
464464}
465465
466466// newWork
467- func (w * worker ) newWork (now time.Time , parentHash common.Hash , reorging bool , reorgReason error ) error {
468- parent := w .chain .GetBlockByHash (parentHash )
467+ func (w * worker ) newWork (now time.Time , parent * types.Block , reorging bool , reorgReason error ) error {
469468 header := & types.Header {
470469 ParentHash : parent .Hash (),
471470 Number : new (big.Int ).Add (parent .Number (), common .Big1 ),
@@ -586,13 +585,14 @@ func (w *worker) newWork(now time.Time, parentHash common.Hash, reorging bool, r
586585}
587586
588587// tryCommitNewWork
589- func (w * worker ) tryCommitNewWork (now time.Time , parent common.Hash , reorging bool , reorgReason error ) (common.Hash , error ) {
588+ func (w * worker ) tryCommitNewWork (now time.Time , parentHash common.Hash , reorging bool , reorgReason error ) (common.Hash , error ) {
589+ parent := w .chain .GetBlockByHash (parentHash )
590590 err := w .newWork (now , parent , reorging , reorgReason )
591591 if err != nil {
592592 return common.Hash {}, fmt .Errorf ("failed creating new work: %w" , err )
593593 }
594594
595- shouldCommit , err := w .handleForks ()
595+ shouldCommit , err := w .handleForks (parent )
596596 if err != nil {
597597 return common.Hash {}, fmt .Errorf ("failed handling forks: %w" , err )
598598 }
@@ -626,17 +626,16 @@ func (w *worker) tryCommitNewWork(now time.Time, parent common.Hash, reorging bo
626626}
627627
628628// handleForks
629- func (w * worker ) handleForks () (bool , error ) {
629+ func (w * worker ) handleForks (parent * types. Block ) (bool , error ) {
630630 // Apply Curie predeployed contract update
631631 if w .chainConfig .CurieBlock != nil && w .chainConfig .CurieBlock .Cmp (w .current .header .Number ) == 0 {
632632 misc .ApplyCurieHardFork (w .current .state )
633633 return true , nil
634634 }
635635
636- // Stop/start miner at Euclid fork boundary on zktrie/mpt nodes
637- if w .chainConfig .IsEuclid (w .current .header .Time ) {
638- parent := w .chain .GetBlockByHash (w .current .header .ParentHash )
639- return parent != nil && ! w .chainConfig .IsEuclid (parent .Time ()), nil
636+ // Apply Feynman hard fork
637+ if w .chainConfig .IsFeynmanTransitionBlock (w .current .header .Time , parent .Time ()) {
638+ misc .ApplyFeynmanHardFork (w .current .state )
640639 }
641640
642641 // Apply EIP-2935
@@ -646,6 +645,12 @@ func (w *worker) handleForks() (bool, error) {
646645 core .ProcessParentBlockHash (w .current .header .ParentHash , vmenv , w .current .state )
647646 }
648647
648+ // Stop/start miner at Euclid fork boundary on zktrie/mpt nodes
649+ if w .chainConfig .IsEuclid (w .current .header .Time ) {
650+ parent := w .chain .GetBlockByHash (w .current .header .ParentHash )
651+ return parent != nil && ! w .chainConfig .IsEuclid (parent .Time ()), nil
652+ }
653+
649654 return false , nil
650655}
651656
0 commit comments