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

chore: provisionSmartWallet flake #10691

Merged
merged 2 commits into from
Dec 13, 2024
Merged

chore: provisionSmartWallet flake #10691

merged 2 commits into from
Dec 13, 2024

Conversation

0xpatrickdev
Copy link
Member

Description

  • motivated after observing cannot read data of published.wallet.${addr}.current: fetch failed in 10638

Security Considerations

None

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

None

Upgrade Considerations

None

Copy link

cloudflare-workers-and-pages bot commented Dec 13, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0cdb981
Status: ✅  Deploy successful!
Preview URL: https://772aea64.agoric-sdk.pages.dev
Branch Preview URL: https://pc-provision-sw-flake.agoric-sdk.pages.dev

View logs

@@ -28,11 +28,11 @@ const retryUntilCondition = async <T>(
{
maxRetries = 6,
retryIntervalMs = 3500,
log = () => {},
log = console.log,
Copy link
Member

Choose a reason for hiding this comment

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

personally I find this log output noisy. Good to change console.log below to this log, but consider leaving the noop default for silence

Copy link
Member Author

Choose a reason for hiding this comment

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

This (+ console.log -> log) would impact a lot of existing tests, so I chose to preserve the existing behavior. I'll see how this looks in local runs and will look to land it in the future:

+    log = () => {},
-    log = console.log,

Copy link
Member

Choose a reason for hiding this comment

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

s/impact/denoise 😉

@0xpatrickdev 0xpatrickdev added automerge:rebase Automatically rebase updates, then merge force:integration Force integration tests to run on PR labels Dec 13, 2024
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.

LGTM

I think it's worthwhile making retryUntilCondition optional on makeE2ETools. But it's not critical.

Comment on lines -58 to -61
// execute sequentially, to avoid "published.wallet.${addr}.current: fetch failed"
const oracleWds: WalletDriver[] = [];
for (const p of oracleWdPs) {
const wd = await p;
Copy link
Member

Choose a reason for hiding this comment

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

yeah... that never did execute sequentially; that is: it didn't wait for one to finish before starting the next.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right, they all start together

@@ -79,13 +79,13 @@ export const commonSetup = async (t: ExecutionContext) => {
console.error('setupRegistry failed', e);
throw e;
}
const tools = await makeAgdTools(t.log, childProcess);
const keyring = await makeKeyring(tools);
const deployBuilder = makeDeployBuilder(tools, fse.readJSON, execa);
const retryUntilCondition = makeRetryUntilCondition({
log: t.log,
setTimeout: globalThis.setTimeout,
Copy link
Member

@dckc dckc Dec 13, 2024

Choose a reason for hiding this comment

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

only top level scripts (incl. test scripts) should be grabbing ambient authority like this use of globalThis.setTimeout.

pre-dates this PR, though, so I'll add it to the list:

Copy link
Member

Choose a reason for hiding this comment

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

I thought we agreed modules that are used only in testing can have ambient authority?

(btw, I bristle at the subjectivity and emotional valence of that issue title. s/Distressing //)

const retryUntilCondition = makeRetryUntilCondition({
log: t.log,
setTimeout: globalThis.setTimeout,
});
const tools = await makeAgdTools(t.log, childProcess, retryUntilCondition);
Copy link
Member

Choose a reason for hiding this comment

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

though... now tools and everything derived from it carries the ambient authority along.

childProcess was already ambient authority though.

() => q.queryData(`published.wallet.${address}.current`),
result => !!result,
`wallet in vstorage ${address}`,
{ log: () => {} }, // suppress logs as this is already noisy
Copy link
Member

Choose a reason for hiding this comment

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

yeah; we do too much logging without giving the caller the ability to turn it off.

Comment on lines 449 to 452
setTimeout,
rpcAddress = 'http://localhost:26657',
apiAddress = 'http://localhost:1317',
retryUntilCondition,
Copy link
Member

Choose a reason for hiding this comment

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

setTimeout is already in the list... I suppose somebody might want the log in retryUntilCondition to be different from the log passed to makeE2ETools, but in the common case, we can fill it in for them:

Suggested change
setTimeout,
rpcAddress = 'http://localhost:26657',
apiAddress = 'http://localhost:1317',
retryUntilCondition,
setTimeout,
rpcAddress = 'http://localhost:26657',
apiAddress = 'http://localhost:1317',
retryUntilCondition = makeRetryUntilCondition({ log, setTimeout }),

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice, good thinking

@0xpatrickdev 0xpatrickdev removed the automerge:rebase Automatically rebase updates, then merge label Dec 13, 2024
Copy link
Contributor

mergify bot commented Dec 13, 2024

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #10691 has been dequeued. The pull request rule doesn't match anymore. The following conditions don't match anymore:

  • label=automerge:rebase.

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

- motivated after observing "cannot read data of published.wallet.agoric1ujmk0492mauq2f2vrcn7ylq3w3x55k0ap9mt2p.current: fetch failed"
  in https://github.com/Agoric/agoric-sdk/actions/runs/12313012295/job/34369641775?pr=10638
- this likely indicates a race between `provision-one`, the vstorage update, or the RPCs view of vstorage
- to address this, retry the vstorage query with `retryUntilCondition`
@0xpatrickdev 0xpatrickdev added the automerge:rebase Automatically rebase updates, then merge label Dec 13, 2024
@mergify mergify bot merged commit 4823e85 into master Dec 13, 2024
86 of 95 checks passed
@mergify mergify bot deleted the pc/provision-sw-flake branch December 13, 2024 18:19
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.

3 participants