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

improve error handling #11070

Merged
merged 7 commits into from
Mar 3, 2025
Merged

improve error handling #11070

merged 7 commits into from
Mar 3, 2025

Conversation

turadg
Copy link
Member

@turadg turadg commented Mar 1, 2025

closes: #10968

Description

  • feat: clean up upon last attest

  • feat: check conflicting evidence before quorum

  • chore: clean up promise handling

  • replace debug() with trace() in PacketTools

  • docs: TxFeed does not inspect evidence

  • test: self disagreement

Security Considerations

slightly stricter check

Scaling Considerations

reduces growth of TxFeed's pending store (which would always have the third operator submission)

Documentation Considerations

some new docs

Testing Considerations

some new tests

Upgrade Considerations

Fully backwards compatible

Copy link

cloudflare-workers-and-pages bot commented Mar 1, 2025

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 741be79
Status: ✅  Deploy successful!
Preview URL: https://df9806b2.agoric-sdk.pages.dev
Branch Preview URL: https://10968-audit-error-handling.agoric-sdk.pages.dev

View logs

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.

"clean up upon last attest" looks pretty important

I should perhaps look this over more carefully, but until I find some reason not to, I approve.

@dckc
Copy link
Member

dckc commented Mar 1, 2025

I presume "closes: #10968" is appropriate; for tracking purposes, I went ahead and added it to the description.

@turadg turadg force-pushed the 10968-audit-error-handling branch from 1bfd098 to 5fe02af Compare March 3, 2025 17:46
@turadg turadg requested a review from dckc March 3, 2025 17:46
@turadg turadg marked this pull request as ready for review March 3, 2025 17:47
@turadg turadg requested a review from a team as a code owner March 3, 2025 17:47
@turadg turadg added the force:integration Force integration tests to run on PR label Mar 3, 2025
@turadg turadg requested a review from 0xpatrickdev March 3, 2025 18:36
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.

good stuff.

store.delete(txHash);

if (found.length === pending.getSize()) {
// all have reported so clean up
Copy link
Member

Choose a reason for hiding this comment

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

so clean-up depends on availability of all operators.

doesn't seem ideal, but seems workable for the coming release.

await E(txNode).setValue(JSON.stringify(capData));
// Don't await, just writing to vstorage.
void E.when(E(marshaller).toCapData(record), capData =>
E(txNode).setValue(JSON.stringify(capData)),
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 if we should be using...

Suggested change
E(txNode).setValue(JSON.stringify(capData)),
E.sendOnly(txNode).setValue(JSON.stringify(capData)),

I don't see any other use of it in agoric-sdk production code, though.

Comment on lines +163 to +164
pending.delete(operatorId);
risks.delete(operatorId);
Copy link
Member

Choose a reason for hiding this comment

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

I suppose this change is covered by the revised remove operator test, though I haven't studied it well enough to be certain.

Comment on lines +227 to +232
// one attestation is now sufficient (half of two) but the only evidence was just removed
await eventLoopIteration();
t.falsy(published);
op2.operator.submitEvidence(evidence);
await eventLoopIteration();
t.deepEqual(published, evidence);
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines -3251 to -3255
'0x000002': {},
'0x000003': {},
'0x000004': {},
'0x000005': {},
'0x000006': {},
Copy link
Member

Choose a reason for hiding this comment

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

so the lack of clean-up was visible right here in the snapshot? interesting.

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Mar 3, 2025
@turadg turadg force-pushed the 10968-audit-error-handling branch from 5fe02af to 741be79 Compare March 3, 2025 19:08
@mergify mergify bot merged commit 7efdf47 into master Mar 3, 2025
84 checks passed
@mergify mergify bot deleted the 10968-audit-error-handling branch March 3, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

audit error handling
3 participants