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(a3p): create a3p test for replace electorate core eval #10241

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

frazarshad
Copy link
Contributor

@frazarshad frazarshad commented Oct 8, 2024

closes: #10138
closes: #10258

Description

A3P tests for the replace electorate core eval. also adds the replace-electorate-core.js script to upgrade.go since it will now be a part of the chain halting upgrade

new tests are as follows:

  • adds new n:replace-electorate which tests for acceptance of new invitations
  • adds params governance proposal and voting tests to z:acceptance

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

@frazarshad frazarshad self-assigned this Oct 8, 2024
Copy link

cloudflare-workers-and-pages bot commented Oct 8, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b5407e
Status: ✅  Deploy successful!
Preview URL: https://fc2f4597.agoric-sdk.pages.dev
Branch Preview URL: https://fraz-replace-committee-a3p.agoric-sdk.pages.dev

View logs

} from './agoric-tools.js';
import { waitUntil } from './utils.js';

test('new committee should be able to vote', async t => {
Copy link
Member

Choose a reason for hiding this comment

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

I suggest splitting this into 2 tests:

  • a test for accepting invitations, which is specific to this upgrade, and belongs here in b:replace...
  • a test for making vault parameter changes, which should be tested on every upgrade, so belongs in z:acceptance

@@ -0,0 +1,5 @@
export const waitUntil = async waitTime => {
Copy link
Member

@dckc dckc Oct 8, 2024

Choose a reason for hiding this comment

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

Suggested change
export const waitUntil = async waitTime => {
export const waitUntil = async (waitTime, { setTimeout = globalThis.setTimeout, now = Date.now } = {}) => {

see

-1,
fromCapData,
);
await waitUntil(latestQuestion.closingRule.deadline);
Copy link
Member

@dckc dckc Oct 8, 2024

Choose a reason for hiding this comment

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

Suggested change
await waitUntil(latestQuestion.closingRule.deadline);
const { setTimeout } = globalThis;
const { now } = Date;
await waitUntil(latestQuestion.closingRule.deadline, { setTimeout, now });

@@ -0,0 +1,5 @@
export const waitUntil = async waitTime => {
while (Math.floor(Date.now() / 1000) < waitTime) {
Copy link
Member

Choose a reason for hiding this comment

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

Why wait repeatedly? Why not just compute the difference between waitTime and now and wait once?

@@ -0,0 +1,5 @@
export const waitUntil = async waitTime => {
while (Math.floor(Date.now() / 1000) < waitTime) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
while (Math.floor(Date.now() / 1000) < waitTime) {
while (Math.floor(now() / 1000) < waitTime) {

Base automatically changed from rs-faraz-replace-charter to master October 10, 2024 06:24
@frazarshad frazarshad added the force:integration Force integration tests to run on PR label Oct 14, 2024
@frazarshad frazarshad requested a review from dckc October 14, 2024 10:58
@frazarshad frazarshad marked this pull request as ready for review October 14, 2024 10:58
@frazarshad frazarshad requested a review from a team as a code owner October 14, 2024 10:58
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

Lots of good stuff here. But the EC changes should take place as part of n:upgrade-next; see #10258 .

The z:acceptance stuff could probably land as its own PR. I would expect it to work before or after the change of membership. Hm... maybe that would complicate things.

@@ -0,0 +1,25 @@
{
"agoricProposal": {
"type": "/agoric.swingset.CoreEvalProposal",
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, the plan is no longer to do a separate CoreEvalProposal.

The EC change should take effect as part of the next SoftwareUpgradeProposal. See

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force:integration Force integration tests to run on PR
Projects
None yet
2 participants