Skip to content

refactor(ntx-builder): extract transaction selection out of the account actor - #2583

Open
SantiagoPittella wants to merge 1 commit into
santiagopittella-ntx-eligibility-columnfrom
santiagopittella-ntx-extract-selection
Open

refactor(ntx-builder): extract transaction selection out of the account actor#2583
SantiagoPittella wants to merge 1 commit into
santiagopittella-ntx-eligibility-columnfrom
santiagopittella-ntx-extract-selection

Conversation

@SantiagoPittella

Copy link
Copy Markdown
Collaborator

Summary

Moves selection, the failure-attribution helpers and the transaction arguments builder out of AccountActor into selection.rs, and moves candidate.rs, allowlist.rs and execute.rs out of actor/

select_candidate becomes a free function that reports the notes an account's allowlist rejects rather than writing them. The actor does that write, as it already does for every other note failure, so behaviour is unchanged.

Changelog

changelog = "none"
reason    = "Internal change only."

@SantiagoPittella
SantiagoPittella force-pushed the santiagopittella-ntx-extract-selection branch from 83603ed to 8f5a83e Compare September 7, 2026 14:18
@SantiagoPittella
SantiagoPittella force-pushed the santiagopittella-ntx-extract-selection branch from 8f5a83e to 73c6b60 Compare September 8, 2026 13:33

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have questions, but since this is an extraction of already existing code it shouldn't hold up the refactor.

Comment on lines +30 to +32
/// Maximum number of `FEE_SPONSORSHIP` notes attached to a single feature note. A feature note with
/// more pending sponsorships than this keeps a subset of this size.
const MAX_SPONSORSHIPS_PER_NOTE: usize = 3;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it simplify matters if we restrict sponsorship to a single note which uses the native token for now? As in, always select the sponsorship with the maximum amount of native token.

Comment on lines +56 to +58
/// Notes dropped because the account does not allowlist their script root. They can never be
/// consumed by this account, so the caller must penalize them.
pub rejected: Vec<(Nullifier, NoteError)>,

Copy link
Copy Markdown
Collaborator

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 reject these at ingress time already I think?

Comment on lines +114 to +115
// A bundle must leave room for its feature note within the per-tx note budget.
let max_sponsorships = MAX_SPONSORSHIPS_PER_NOTE.min(max_notes - 1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How does this work? I thought each feature note gets a sponsorship note?

Comment on lines +145 to +146
// Notes just dropped by the allowlist re-enter eligibility through backoff, so ask for a
// re-check on the next block rather than reporting the account as having no pending work.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this because the allowlist is a storage item? That's.. really annoying.

@SantiagoPittella
SantiagoPittella force-pushed the santiagopittella-ntx-extract-selection branch from 73c6b60 to 9616274 Compare September 9, 2026 21:00
@SantiagoPittella
SantiagoPittella force-pushed the santiagopittella-ntx-extract-selection branch from 9616274 to 92c5e86 Compare September 10, 2026 16:47
@SantiagoPittella
SantiagoPittella force-pushed the santiagopittella-ntx-extract-selection branch from 92c5e86 to aa7ec8a Compare September 11, 2026 21:07
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.

2 participants