Skip to content

Conversation

@prashantkumar1982
Copy link
Contributor

@prashantkumar1982 prashantkumar1982 commented Sep 24, 2025

  • Workflow Registry v2 was using WaitforDon() as a way to ensure contractReader was ready. It had to be changed because in a gateway node, WaitForDON() hangs indefinitely. So changed to a sync loop checking contractreader init.
  • Fixed few bugs in how to fetch allowlist from onchain contract via ChainReader, fixed bugs in application.go where WR wasn't populated
  • DigestForRequest() wasn't consistent, causing major debugging nightmares because digest was computed differently for same requests, and it was non-deterministic behavior. Fixed that.

@chudilka1 chudilka1 added the run-e2e-regression This label triggers regression system tests on PR label Sep 26, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@prashantkumar1982 prashantkumar1982 changed the title wip e2e testing with auth enalbed Vault DON: e2e testing with auth enabled Oct 8, 2025
@prashantkumar1982 prashantkumar1982 marked this pull request as ready for review October 9, 2025 04:30
@prashantkumar1982 prashantkumar1982 requested review from a team as code owners October 9, 2025 04:30
@cl-sonarqube-production
Copy link

getPeerID: getPeerID,
srvs: srvcs,
workflowRegistrySyncer: workflowRegistrySyncer,
orgResolver: orgResolver,
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this line removed intentionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, seems like caused during merge conflicts resolution. Will fix it asap

Comment on lines +271 to +273
} else if req.Method == vaulttypes.MethodSecretsGet {
ar := h.newActiveRequest(req, callback)
return h.handleSecretsGet(ctx, ar)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? Could use a comment for why Get differs from other methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I'm not sure I understand this bit either

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Get is not exposed to users. It is only there on dev builds for e2e testing. So no point doing auth for this method.
Once we write different tests for workflows fetching and decrypting secrets, we can remove Get entirely from gateway.
I will add a comment here.

Comment on lines +193 to +202
// Async initialization of contract reader because there is an on-chain
// call dependency. Blocking on initialization results in a
// deadlock. Instead wait until the node has identified it's DON
// as a proxy for a DON and on-chain ready state .
reader, err := w.newWorkflowRegistryContractReader(ctx)
if err != nil {
w.lggr.Errorw("contract reader unavailable", "error", err.Error())
break
}
w.contractReader = reader
Copy link
Contributor

Choose a reason for hiding this comment

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

If I read this comment correctly, then the error might occur even when everything is fine (we are waiting for the on-chain state to be ready). In that case, the log should be a debug or info log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, error level seems too much. Will update it.

require.NoError(t, err, "failed to allowlist request")

framework.L.Info().Msgf("Allowlisting request digest at contract %s, for owner: %s, digestHexStr: %s", wfRegistryContract.Address().Hex(), owner, hex.EncodeToString(digest[:]))
time.Sleep(5 * time.Second) // wait a bit to ensure the allowlist is propagated
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to mine/advance the block instead of sleeping.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So some more context is that the sleep is also there to allow the vault don and gateway to sync this list using workflow registry syncer.
If we quickly send a request after allowlisting, it might fail because vault don/gateway haven't yet fetched the latest list.

@DeividasK DeividasK added this pull request to the merge queue Oct 9, 2025
@DeividasK
Copy link
Contributor

Enabled merge to unblock other PRs

Merged via the queue into develop with commit a15d780 Oct 9, 2025
200 of 201 checks passed
@DeividasK DeividasK deleted the vault_e2e_auth branch October 9, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e-regression This label triggers regression system tests on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants