Skip to content

Conversation

@jstuczyn
Copy link
Contributor

@jstuczyn jstuczyn commented Aug 11, 2025

NET-486

this PR changes behaviour of the credential proxy. rather than making the ecash deposits on demand, it will now hold a pool of available deposits. furthermore it will monitor for quorum state. this will reduce wastage in few ways:

  • no deposits will be made if issuance would have failed
  • if chain halts for few minutes or network to the rpc node experiences issues, the deposits buffer will allow continous issuance of ticketbooks (until it runs out of course)

This change is Reviewable

@vercel
Copy link

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nym-explorer-v2 Ready Ready Preview Comment Aug 29, 2025 8:33am
nym-node-status Ready Ready Preview Comment Aug 29, 2025 8:33am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs-nextra Ignored Ignored Preview Aug 29, 2025 8:33am

Copy link
Contributor

@mmsinclair mmsinclair left a comment

Choose a reason for hiding this comment

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

Looks good for a 1st step that we can iterate from

Added some comments for @benedettadavico as a reminder to add monitoring on logs to look for critical errors and notify us

let ed25519_keypair = ed25519::KeyPair::new(&mut rng);
) -> Result<Vec<WalletShare>, CredentialProxyError> {
// don't proceed if we don't have quorum available as the request will definitely fail
if !state.quorum_available() {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this future proofing, or something that it detects somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just an early escape hatch. if we don't have a quorum, there's not a chance we'll succeed in obtaining threshold number of shares

// that one is tricky. deposits technically got made, but we somehow failed to parse response,
// in this case terminate the proxy with 0 exit code so it wouldn't get automatically restarted
// because it requires some serious MANUAL intervention
error!("CRITICAL FAILURE: failed to parse out deposit information from the contract transaction. either the chain got upgraded and the schema changed or the ecash contract got changed! terminating the process. it has to be inspected manually. error was: {err}");
Copy link
Contributor

Choose a reason for hiding this comment

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

@benedettadavico reminder to add some monitoring to watch for this

}

async fn check_quorum_state(&self) -> Result<bool, CredentialProxyError> {
let client_guard = self.client.query_chain().await;
Copy link
Contributor

Choose a reason for hiding this comment

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

ok, I see now where this check is done (from comment above)

@jstuczyn jstuczyn merged commit e9acc01 into develop Aug 29, 2025
17 of 18 checks passed
@jstuczyn jstuczyn deleted the feature/credential-proxy-deposit-pool branch August 29, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants