Skip to content

chore: re-add execution of network transactions and add expiration#2148

Open
SantiagoPittella wants to merge 1 commit into
nextfrom
santiagopittella-ntx-builder-block-sub-phase-3
Open

chore: re-add execution of network transactions and add expiration#2148
SantiagoPittella wants to merge 1 commit into
nextfrom
santiagopittella-ntx-builder-block-sub-phase-3

Conversation

@SantiagoPittella
Copy link
Copy Markdown
Collaborator

Third and final PR of the ntx-builder block-subscription refactor (follows #2120 and #2144). This PR reconnects the execution path so the ntx-builder actually builds and submits network transactions again.

After catch-up, an account actor with pending notes selects a candidate, executes/proves/submits it, then enters a WaitForBlock state and detects landing purely from local state. If the transaction doesn't land within tx_expiration_delta blocks, the actor resubmits.

Submitted transactions also carry an on-chain expiration: a pre-compiled transaction script (update_expiration_block_delta) is injected via TransactionArgs, so a stale tx is rejected by the chain rather than landing late.

@SantiagoPittella SantiagoPittella force-pushed the santiagopittella-ntx-builder-block-sub-phase-3 branch from 8b4366b to b446bbd Compare May 27, 2026 16:38
long = "tx-expiration-delta",
env = ENV_TX_EXPIRATION_DELTA,
default_value_t = DEFAULT_TX_EXPIRATION_DELTA,
value_parser = clap::value_parser!(u16).range(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.

You could make this a NonZeroU16

Comment on lines +196 to +198
/// Returns `true` if every one of `nullifiers` for `account_id` has been marked consumed
/// (`committed_at IS NOT NULL`), i.e. the actor's submitted transaction has landed in a committed
/// block. An empty `nullifiers` slice trivially returns `true`.
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.

Interesting approach. iiuc this works by virtue of the actor being the only possible consumer of these notes.

This is technically not true though; because I think they can be recalled for example.

This may be good enough for a first cut at this.

We could also revisit how we perform notifications. One option could be to store the latest N blocks as shared data that actors can access. So an actor waiting on a transaction could count the blocks going by but also inspect their transactions directly.

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.

Or alternatively, a quicker solution would be to have the coordinator also store the last transaction ID of each account in the account's table. The actor can then pull that. That way we stick with the pure database approach for now, and we can revisit that decision holistically later.

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