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

test(nns): Add a test for NNS proposals being adopted in the golden state #3461

Draft
wants to merge 4 commits into
base: arshavir/add-nns-governance-test-function-adopt_proposal
Choose a base branch
from

Conversation

aterga
Copy link
Contributor

@aterga aterga commented Jan 15, 2025

This PR adds a new target //rs/nns/integration_tests:test_proposal_with_golden_nns_state that allows testing the effect of a proposal being adopted in a system that has the golden state installed. While this target is designed for manual experiments, it is covered by a nightly test to avoid bit rot.

< Previous PR |

@github-actions github-actions bot added the test label Jan 15, 2025
@aterga aterga changed the base branch from master to arshavir/add-nns-governance-test-function-adopt_proposal January 15, 2025 15:10
@aterga aterga force-pushed the arshavir/add-nns-governance-test-function-adopt_proposal branch from a577397 to 48cef74 Compare January 15, 2025 15:48
rs/nns/integration_tests/BUILD.bazel Show resolved Hide resolved
rs/nns/integration_tests/BUILD.bazel Outdated Show resolved Hide resolved
true,
);

// Step 3: Verify result(s): In a short while, the canister should be running the new code.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say that this is part of setting up the world (step 1). At this point, we are not yet verifying the code under test. (We are merely installing adopt_proposal so that we can run the code under test, namely, proposal execution, specifically for network economics.)

Comment on lines +29 to +30
// Phase I. Upgrade NNS Governance to a test-only version (using a super powerful neuron) that
// allows adopting any proposal by calling adopt_proposal.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Phase I. Upgrade NNS Governance to a test-only version (using a super powerful neuron) that
// allows adopting any proposal by calling adopt_proposal.
// Step 1.2: Upgrade NNS Governance to a test-only version, which
// has adopt_proposal method.

Comment on lines +89 to +91
adopt_proposal(&state_machine, proposal_id).unwrap();

nns_wait_for_proposal_execution(&state_machine, proposal_id.id);
Copy link
Contributor

Choose a reason for hiding this comment

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

THIS is where the code under test gets executed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, you're not wrong.

But from another perspective, this is not a test for adopt_proposal (that's sufficiently tested using unit tests).

The point of this test is, as I tried to explain in the PR description, to enable humans to answer the question:

  1. Is a given proposal submitted in the system from which the golden state snapshot was taken going to be executed successfully, assuming the NNS community adopts it?
  2. Is the proposal going to have the expected / desired effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll also explain this in a doc comment for this test.

@aterga aterga force-pushed the arshavir/validate-nns-proposal-134803 branch from 69a4ecf to fa409b3 Compare January 15, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants