Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulators/ethereum/engine: Fix bugs for ForkID and Missing Ancenstor Tests #936

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions simulators/ethereum/engine/suites/engine/fork_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/hive/simulators/ethereum/engine/clmock"
"github.com/ethereum/hive/simulators/ethereum/engine/config"
"github.com/ethereum/hive/simulators/ethereum/engine/devp2p"
Expand Down Expand Up @@ -34,6 +35,19 @@ func (ft ForkIDSpec) GetName() string {
return strings.Join(name, ", ")
}

func (s ForkIDSpec) GetForkConfig() *config.ForkConfig {
forkConfig := s.BaseSpec.GetForkConfig()
if forkConfig == nil {
return nil
}
// Merge fork happen at block 0
mainFork := s.GetMainFork()
if mainFork == config.Paris {
forkConfig.ParisNumber = common.Big0
}
return forkConfig
}

func (ft ForkIDSpec) Execute(t *test.Env) {
// Wait until TTD is reached by this client
t.CLMock.WaitForTTD()
Expand Down
6 changes: 6 additions & 0 deletions simulators/ethereum/engine/suites/engine/invalid_ancestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ func (tc InvalidMissingAncestorReOrgSyncTest) Execute(t *test.Env) {
}
},
})

if !tc.ReOrgFromCanonical {
// Add back the original client before side chain production
t.CLMock.AddEngineClient(t.Engine)
}

t.Log("INFO: Starting side chain production")
t.CLMock.ProduceSingleBlock(clmock.BlockProcessCallbacks{
// Note: We perform the test in the middle of payload creation by the CL Mock, in order to be able to
Expand Down