Skip to content

Commit

Permalink
add log info when enabling parallel evm
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhang2023 committed Oct 17, 2024
1 parent 5bc45ea commit 4746b76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,10 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
if bc.vmConfig.EnableParallelExecLegacy {
bc.CreateParallelProcessor(bc.vmConfig.ParallelTxNum)
bc.CreateSerialProcessor(chainConfig, bc, engine)
log.Info("Parallel V1 enabled", "parallelNum", bc.vmConfig.ParallelTxNum)
} else if bc.vmConfig.EnableParallelExec {
bc.processor = newPEVMProcessor(chainConfig, bc, engine)
log.Info("Parallel V2 enabled", "parallelNum", ParallelNum())
} else {
bc.processor = NewStateProcessor(chainConfig, bc, engine)
}
Expand Down
5 changes: 3 additions & 2 deletions core/parallel_state_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
var runner chan func()

func init() {
runner = make(chan func(), runtime.NumCPU())
for i := 0; i < runtime.NumCPU(); i++ {
cpuNum := runtime.NumCPU()
runner = make(chan func(), cpuNum)
for i := 0; i < cpuNum; i++ {
go func() {
for f := range runner {
f()
Expand Down

0 comments on commit 4746b76

Please sign in to comment.