Skip to content

tests: add multi validators tests setup#51

Draft
julienrbrt wants to merge 14 commits into
mainfrom
julien/slashing-multi
Draft

tests: add multi validators tests setup#51
julienrbrt wants to merge 14 commits into
mainfrom
julien/slashing-multi

Conversation

@julienrbrt

Copy link
Copy Markdown
Member

Base automatically changed from julien/slashing to main June 3, 2026 10:06
Resolve conflicts by keeping the multi-validator test code from
julien/slashing-multi (the full individual validator downtime test)
over the TODO placeholder from main's squash-merged PR #39.
Comment thread tests/e2e/scripts/provider-init.sh Outdated
$BINARY genesis gentx val "1000000000${DENOM}" --home "$HOME_DIR" --keyring-backend test --chain-id "$CHAIN_ID"

# Create gentx for val2
$BINARY genesis gentx val2 "1000000000${DENOM}" --home "$VAL2_HOME_DIR" --keyring-backend test --chain-id "$CHAIN_ID"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If val2 becomes offline, it should have less than 2/3 of the VP. Here looks like it has 50%.

Comment thread tests/e2e/e2e_setup_test.go Outdated
// Start provider val1 (second validator node) connecting to val0 as persistent peer
s.T().Log("starting provider val1 container...")

val0P2PAddr := fmt.Sprintf("%s:26656", val0Resource.Container.Name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a leading / so you should use val0Resource.Container.Name[1:].
In addition apparently --persistent-peers requires a nodeID, so the correct format should be:

fmt.Sprintf("%s@%s:26656", nodeID, val0Resource.Container.Name[1:])

Comment thread tests/e2e/e2e_downtime_slash_test.go
s.Require().GreaterOrEqual(len(s.consumerValRes), 2,
"need at least 2 consumer validator containers for individual downtime test")

valoperAddr, tokensBefore := s.getProviderValidatorTokens()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that you want select the one-of-two validators that has less than 2/3 of VP, this function should be changed to something more accurate. It might return the wrong validator.

Comment thread tests/e2e/e2e_setup_test.go Outdated
"26657/tcp": {{HostIP: "", HostPort: "26658"}},
"9090/tcp": {{HostIP: "", HostPort: "9091"}},
"1317/tcp": {{HostIP: "", HostPort: "1318"}},
"26656/tcp": {{HostIP: "", HostPort: "26658"}},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Port collision with line 371.

Comment thread tests/e2e/e2e_setup_test.go Outdated
// Create consumer val1 (second validator node with val2's keys)
s.T().Log("setting up consumer val1 node...")

consumerVal2Dir, err := os.MkdirTemp("", "vaas-e2e-consumer-val2-")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the double naming val1/val2 ? This is confusing.

Comment thread tests/e2e/e2e_setup_test.go Outdated
s.consumerValRes = append(s.consumerValRes, consumerVal1Resource)
s.T().Logf("consumer val1 container started: %s", consumerVal1Resource.Container.ID[:12])

time.Sleep(5 * time.Second)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test val1 liveness instead of sleep.

@julienrbrt julienrbrt marked this pull request as draft June 3, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants