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

9281 durable orchestrator #9532

Merged
merged 10 commits into from
Jun 19, 2024
Merged

9281 durable orchestrator #9532

merged 10 commits into from
Jun 19, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented Jun 19, 2024

refs: #9281

Description

AsyncFlow requires that everything passing the membrane is durable. This makes the facade objects durable to conform.

Following #9529

Security Considerations

none

Scaling Considerations

Exo for each chain and each account

Documentation Considerations

none

Testing Considerations

Existing coverage

Upgrade Considerations

not yet deployed

@turadg turadg requested review from dtribble and 0xpatrickdev June 19, 2024 16:08
Copy link

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62bdb8a
Status: ✅  Deploy successful!
Preview URL: https://8390c7ee.agoric-sdk.pages.dev
Branch Preview URL: https://9281-local-exo.agoric-sdk.pages.dev

View logs

chainId: localChainInfo.chainId,
addressEncoding: 'bech32',
}),
// FIXME storage path
Copy link
Member

Choose a reason for hiding this comment

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

What ticket capture this? Maybe vstorage logging ?

Suggested change
// FIXME storage path
// FIXME storage path https://github.com/Agoric/agoric-sdk/issues/9066

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for looking these up. I expect we'll get to them soon so I'll let this merge as is to save the CI time. Maybe include the links on a next PR.

@@ -169,7 +169,7 @@ export const prepareChainAccountKit = zone =>
},
async onClose(_connection, reason) {
trace(`ICA Channel closed. Reason: ${reason}`);
// XXX handle connection closing
// FIXME handle connection closing
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
// FIXME handle connection closing
// FIXME handle connection closing https://github.com/Agoric/agoric-sdk/issues/9192

@@ -67,18 +58,18 @@ const PUBLIC_TOPICS = {
* @param {Remote<TimerService>} timerService
* @param {ChainHub} chainHub
*/
export const prepareLocalChainAccountKit = (
export const prepareLocalOrchestrationAccountKit = (
Copy link
Member

Choose a reason for hiding this comment

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

Nice rename 👏

return V(this.state.account).deposit(payment, optAmountShape);
/** @type {OrchestrationAccount<any>['deposit']} */
async deposit(payment) {
await V(this.state.account).deposit(payment);
Copy link
Member

Choose a reason for hiding this comment

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

In a future PR we might consider updating OrchestrationAccountI['deposit'] to return Promise<Amount<'nat'>>. I don't see a reason to swallow that response.

Tangentially - with the revised implementation plan for #9193 only LocalOrchestrationAccount will have .deposit().

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Jun 19, 2024
@mergify mergify bot merged commit c244e96 into master Jun 19, 2024
85 checks passed
@mergify mergify bot deleted the 9281-local-exo branch June 19, 2024 17:56
mergify bot pushed a commit that referenced this pull request Nov 13, 2024
closes: #XXXX
refs: #9532 which seems to be where the `M.bigint()` came from

## Description

The `DenomAmountShape` was using only `M.bigint()` to validate a DenomAmount, which misses an opportunity to easily ensure that these amount values never go negative. This PR changes this to `M.nat()`, making it consistent with the immediately following `AnyNatAmountShape` as well.

### Security Considerations

Accidentally admitting negative value amounts might enable attacks allowing overdrawn spending or creation of new units. There may or may not be such a security vulnerability in this code, depending on whether the non-negative condition is ensured by other means, which I cannot determine. But fixing this is *at least* a belt-and-suspenders enforcement, through a declarative expression of the constraint.

### Scaling Considerations

none

### Documentation Considerations

should just remove the need to explain something else for the programmer to worry about.

### Testing Considerations

If we can find an actual vulnerability that this PR fixes, then we could test the difference. But I have not.

### Upgrade Considerations

If there are any such negative values in existing use, this PR is likely to break them. But their presence likely indicates corruption that we'd be better off causing a failure, rather than proceeding silently to corrupt other state.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants