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

6701 EC removeOracles #6977

Merged
merged 5 commits into from
Feb 13, 2023
Merged

6701 EC removeOracles #6977

merged 5 commits into from
Feb 13, 2023

Conversation

turadg
Copy link
Member

@turadg turadg commented Feb 11, 2023

closes: #6701
stacks on #6975

Description

Lets EC disable an oracle in the pool

Security Considerations

After being disabled, pushPrice no longer works. getStatus does. I figure that's good for checking if it's disabled.

Scaling Considerations

The durable oracleKit is removed from the oracles map but it's not "deleted" in that someone may be holding a reference to its oracle facet from an offer result.

Documentation Considerations

The new feature will be documented in Econ Gov GUI and its docs.

Testing Considerations

Uses the test-oracle-integration test to do both governance and pushes through the smart wallet. Some of on-chain paths aren't tested. The disabling is low enough that I think the wallet tests suffice.

@turadg turadg requested review from dckc and Chris-Hibbert February 11, 2023 23:48
@turadg turadg force-pushed the 6701-ec-addOracles branch from 91d6594 to e972759 Compare February 11, 2023 23:56
@turadg turadg force-pushed the 6701-ec-removeOracles branch from da17baf to 8f93647 Compare February 12, 2023 00:24
This was referenced Feb 12, 2023
message: 'pushPrice for disabled oracle',
},
);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

We should test that aggregation continues to work.

What's the minimum number of sources that are required in order to calculate an aggregation? Does the disabled source count toward that total?

Copy link
Member Author

Choose a reason for hiding this comment

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

We should test that aggregation continues to work.

Ok, will do.

What's the minimum number of sources that are required in order to calculate an aggregation?

It's specified in minSubmissionCount of the config when creating a feed. It gets read here,

if (
details.get(roundId).submissions.length <
details.get(roundId).minSubmissions
) {
return [false, 0];

Does the disabled source count toward that total?

It doesn't change anything. It's just as if the oracle wallet never pushed a price.

@@ -316,7 +316,8 @@ test.serial('errors', async t => {
);
});

test.serial('govern addOracle', async t => {
// test both addOracles and removeOracles in same test to reuse the lengthy the EC setup
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
// test both addOracles and removeOracles in same test to reuse the lengthy the EC setup
// test both addOracles and removeOracles in same test to reuse the lengthy EC setup

Copy link
Member

Choose a reason for hiding this comment

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

☝️

Copy link
Member Author

Choose a reason for hiding this comment

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

durned rebase. done

@turadg turadg force-pushed the 6701-ec-addOracles branch from e972759 to 9b6dbc5 Compare February 12, 2023 23:21
Base automatically changed from 6701-ec-addOracles to master February 13, 2023 00:21
@turadg turadg force-pushed the 6701-ec-removeOracles branch from 8f93647 to bcf33fe Compare February 13, 2023 02:07
@turadg turadg requested a review from Chris-Hibbert February 13, 2023 02:07
@turadg turadg force-pushed the 6701-ec-removeOracles branch from bcf33fe to 70e196e Compare February 13, 2023 18:55
@@ -0,0 +1,124 @@
import { Fail } from '@agoric/assert';
Copy link
Member Author

Choose a reason for hiding this comment

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

this is really a rename 1023f04

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.

looks pretty thorough

part of me feels obliged to reproduce your results using the CLI and smoke test script(s), but I think the whole team is going to be doing a bunch of that very soon

* @param {Awaited<ReturnType<typeof coalesceUpdates>>} state
* @param {Brand<'nat'>} brand
*/
export const purseBalance = (state, brand) => {
Copy link
Member

Choose a reason for hiding this comment

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

this will only work for the invitation purse, right? call it invitationPurseBalance?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. This was removed and reappeared from a faulty rebase so I'll just remove it.

* @param {string} voterAcceptanceOID
* @returns {Promise<import('@agoric/smart-wallet/src/invitations').ContinuingInvitationSpec>}
*/
export const voteForOpenQuestion = async (
Copy link
Member

Choose a reason for hiding this comment

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

👏

@@ -311,22 +281,35 @@ test('govern offerFilter', async t => {
// 44 tested above
t.is(currentState.offerToUsedInvitation[46].value[0].description, 'Voter0');

// Call for a vote ////////////////////////////////
Copy link
Member

Choose a reason for hiding this comment

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

consider t.log('Call for a vote')?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm really on the fence about that. Is it useful log output? It won't interleave with debugging output.

I'm opting to punt on this change until there's a clear best practice.

Copy link
Member

Choose a reason for hiding this comment

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

Is it useful log output?

I like it when the t.log() output tells a story...

It won't interleave with debugging output.

I think it does with failures of t.is() and t.deepEqual() and such. But yeah, it's out of sync with console.log().

Punting is fair. Thanks for considering it.

Comment on lines 317 to 289
previousOffer: 46,
invitationMakerName: 'makeVoteInvitation',
invitationArgs: harden([yesPosition, questionHandle]),
previousOffer: 44,
Copy link
Member

Choose a reason for hiding this comment

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

Help me understand why previousOffer is changing?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the differ getting confused. This invitation is for VoteOnPauseOffers which needs 44, instead of makeVoteInvitation which needed 46.

But I've been replacing numbers with strings so I'll do that here too.

removeOracle: async oracleId => {
trace('deleteOracle', oracleId);
const kit = oracles.get(oracleId);
kit.admin.disable();
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why disable rather than revoke. Can it be enabled again?

(thanks for adding the JS standard revoke() thing to https://github.com/dckc/awesome-ocap/wiki/CareTaker )

Copy link
Member Author

Choose a reason for hiding this comment

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

that was the idea. right now there's no enable() method but the state is a boolean so it could be toggled.

t.like(await E(creatorFacet).getRoundData(2), {
roundId: 2n,
// median of two is their average
answer: 250n,
Copy link
Member

Choose a reason for hiding this comment

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

👏

@@ -316,7 +316,8 @@ test.serial('errors', async t => {
);
});

test.serial('govern addOracle', async t => {
// test both addOracles and removeOracles in same test to reuse the lengthy the EC setup
Copy link
Member

Choose a reason for hiding this comment

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

☝️

@turadg turadg force-pushed the 6701-ec-removeOracles branch from 70e196e to 9b6e2cd Compare February 13, 2023 19:42
@turadg turadg added the automerge:no-update (expert!) Automatically merge without updates label Feb 13, 2023
@mergify mergify bot merged commit 943b3a4 into master Feb 13, 2023
@mergify mergify bot deleted the 6701-ec-removeOracles branch February 13, 2023 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:no-update (expert!) Automatically merge without updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EC can propose and vote on changes to oracle operators list
3 participants