-
Notifications
You must be signed in to change notification settings - Fork 214
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
Operator attestation policy #10721
Operator attestation policy #10721
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
186dd94
to
cd2a40c
Compare
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 good
this review is a bit rushed, so you may want to get more eyes.
or let me know if you want me to look more closely.
@@ -79,6 +79,21 @@ test('happy aggregation', async t => { | |||
}); | |||
}); | |||
|
|||
test('disabled operator', async t => { |
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; the "unknown transaction" test mixed in testing this, and I wondered about reducing coverage.
@@ -118,10 +118,12 @@ export const prepareTransactionFeedKit = (zone, zcf) => { | |||
/** | |||
* Add evidence from an operator. | |||
* | |||
* NB: the operatorKit is responsible for |
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.
for... what?
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 must have gotten a Slack notification!
The operatorKit is responsible for preventing a disabled kit from attesting.
I'll get that in before merge. I'll probably wait for another reviewer's comments before pushing again.
minAttestations, | ||
'necessary attestations', | ||
); | ||
if (found.length < minAttestations) { |
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 seems to be the gist of it.
for (const pendingStore of pending.values()) { | ||
pendingStore.delete(txHash); | ||
// sufficient agreement, so remove from pending and publish | ||
for (const store of found) { |
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.
the change from pending.values()
to found
... I had to think a bit to convince myself that make no difference.
// but this time the third is different | ||
op3.operator.submitEvidence(MockCctpTxEvidences.AGORIC_PLUS_DYDX()); | ||
|
||
// Now third operator catches up with same evidence already published |
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 haven't thought carefully about whether this is sufficient test coverage.
lastEvidence = next; | ||
} else { | ||
trace( | ||
'🚨 conflicting evidence for', |
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 this a red-alert situation? It seems like we recover: we don't act on inconsistent evidence.
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 think it deserves immediate operational attention if two oracles are disagreeing. At least one is unreliable and may require immediate action.
lastEvidence, | ||
'!=', | ||
next, |
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.
if we have to use this in anger, I expect we'll want to see which operator submitted which evidence.
is that already traced?
|
||
// it's simply ignored | ||
t.notThrows(() => op3.operator.submitEvidence(e1bad)); | ||
t.like(await evidenceSubscriber.getUpdateSince(0), { |
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.
why ask for updates since 0 again? isn't the n+1th call supposed to pass in the updateCount from the nth call?
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.
It's just a handy way to ask for the latest without risk of a hanging await while writing tests
updateCount: 1n, | ||
}); | ||
|
||
// now another op repeats the bad evidence, so it's published to the stream. |
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.
ooh. tricky.
|
||
// Constraints on the configurations | ||
const MAINNET_EXPECTED_ORACLES = 3; | ||
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.
👍
TODO in code
Description
Update
TransactionFeed
to publish when a majority of operators to attest (previous required unanimous). Conflicts log a loud error and don't publish.Also updates the contract test to have 3 operators (per Mainnet policy) and rely on unit tests for the other values.
Security Considerations
Adds assertions to the deploy-config to help ensure that Mainnet has three unique operators, per security policy.
Scaling Considerations
Each new attestation iterates over three stores for matching values.
Documentation Considerations
Nothing end-user. OCW is documented elsewhere.
Testing Considerations
CI
Upgrade Considerations
not yet deployed.
contract is upgradable but changing the settlementAccountAddress will require creating a new TransactionFeed (as is the case for the Settler object.