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

Fix orch.getChain() race #10225

Merged
merged 3 commits into from
Oct 4, 2024
Merged

Fix orch.getChain() race #10225

merged 3 commits into from
Oct 4, 2024

Conversation

mhofman
Copy link
Member

@mhofman mhofman commented Oct 4, 2024

closes: #10219

best reviewed commit-by-commit

Description

Stores a structure in the chainByName store with the vow or settled value, allowing getChain to return the vow for the pending lookup, and getDenomInfo to continue synchronously returning if the chain info is available.

To avoid confusion, this also moves the chainByName map store definition inside prepareOrchestratorKit

Security Considerations

Nothing new, but getDenomInfo basically allows probing synchronously for the result of a getChain lookup.

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

Added unit tests covering this race

Upgrade Considerations

Contracts can picked up this fix as part of a new orchestration NPM package.

@mhofman mhofman requested review from turadg and 0xpatrickdev October 4, 2024 19:45
@mhofman mhofman requested a review from a team as a code owner October 4, 2024 19:45
@@ -195,7 +244,9 @@ test.serial('asset / denom info', async t => {
});
}

const ag = await orc.getChain('agoric');
const agP = orc.getChain('agoric');
t.throws(() => orc.getDenomInfo(agDenom));
Copy link
Member

Choose a reason for hiding this comment

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

please include the error message

@mhofman mhofman force-pushed the mhofman/10219-fix-getchain-race branch from 609867c to 2fe7153 Compare October 4, 2024 20:47
Copy link

cloudflare-workers-and-pages bot commented Oct 4, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b2547f
Status: ✅  Deploy successful!
Preview URL: https://88b03a1a.agoric-sdk.pages.dev
Branch Preview URL: https://mhofman-10219-fix-getchain-r.agoric-sdk.pages.dev

View logs

@mhofman mhofman force-pushed the mhofman/10219-fix-getchain-race branch from 2fe7153 to 59795be Compare October 4, 2024 20:51
@mhofman mhofman added the automerge:rebase Automatically rebase updates, then merge label Oct 4, 2024
@mhofman mhofman force-pushed the mhofman/10219-fix-getchain-race branch from 59795be to 5b2547f Compare October 4, 2024 21:12
@mergify mergify bot merged commit 2670a4e into master Oct 4, 2024
80 checks passed
@mergify mergify bot deleted the mhofman/10219-fix-getchain-race branch October 4, 2024 21:50
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.

Orchestrator chain logic is racy
2 participants