-
Notifications
You must be signed in to change notification settings - Fork 228
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
6701 EC removeOracles #6977
Conversation
91d6594
to
e972759
Compare
da17baf
to
8f93647
Compare
message: 'pushPrice for disabled oracle', | ||
}, | ||
); | ||
}); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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,
agoric-sdk/packages/inter-protocol/src/price/roundsManager.js
Lines 363 to 367 in adc0836
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
durned rebase. done
e972759
to
9b6dbc5
Compare
8f93647
to
bcf33fe
Compare
bcf33fe
to
70e196e
Compare
@@ -0,0 +1,124 @@ | |||
import { Fail } from '@agoric/assert'; |
There was a problem hiding this comment.
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
There was a problem hiding this 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) => { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 ( |
There was a problem hiding this comment.
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 //////////////////////////////// |
There was a problem hiding this comment.
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')
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
previousOffer: 46, | ||
invitationMakerName: 'makeVoteInvitation', | ||
invitationArgs: harden([yesPosition, questionHandle]), | ||
previousOffer: 44, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 )
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️
70e196e
to
9b6e2cd
Compare
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 itsoracle
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.