Skip to content

Commit 35c9595

Browse files
committed
docs(ntx-builder): clarify network note FPI support
1 parent 77cfb29 commit 35c9595

5 files changed

Lines changed: 27 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- [BREAKING] Renamed `SubmitProvenBatch` RPC endpoint to `SubmitProvenTxBatch` ([#2094](https://github.com/0xMiden/node/pull/2094)).
3535
- Fixed block producer mempool panic when selecting transactions that depend on notes created by pruned committed transactions ([#2097](https://github.com/0xMiden/node/pull/2097)).
3636
- Implemented filtering based on the network account note script root allowlist in ntx-builder ([#2042](https://github.com/0xMiden/node/issues/2042)).
37+
- Documented FPI support and diagnostics for network-account notes that call public foreign accounts ([#2046](https://github.com/0xMiden/node/issues/2046)).
3738

3839
- [BREAKING] Renamed `ExplorerStatusDetails` fields in the network monitor's `/status` payload from `number_of_*` to `total_*` (`total_transactions`, `total_nullifiers`, `total_notes`, `total_account_updates`). The values now represent network-wide cumulative totals from the explorer's `overviewStats` query instead of last-block counts.
3940
- [BREAKING] Removed `--wallet-filepath` / `--counter-filepath` flags and the `MIDEN_MONITOR_WALLET_FILEPATH` / `MIDEN_MONITOR_COUNTER_FILEPATH` env vars from the network monitor. The monitor now keeps wallet and counter accounts fully in memory and regenerates them on every startup; the dashboard's counter value resets to zero on restart.

bin/ntx-builder/src/actor/execute.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ impl DataStore for NtxDataStore {
608608
async move {
609609
debug_assert_eq!(ref_block, self.reference_block.block_num());
610610

611-
// Get foreign account inputs from store, retrying on transient gRPC failures.
611+
// Network-note FPI resolves public foreign accounts from the store at the transaction's
612+
// reference block. The account code is loaded below so the executor can call it.
612613
let account_inputs =
613614
(|| async { self.store.get_account_inputs(foreign_account_id, ref_block).await })
614615
.retry(self.store_backoff())

bin/ntx-builder/src/clients/store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl StoreClient {
163163
account_id: AccountId,
164164
block_num: BlockNumber,
165165
) -> Result<AccountInputs, StoreError> {
166-
// Construct proto request.
166+
// Request the public foreign account data needed for FPI at the execution reference block.
167167
let proto_request = proto::rpc::AccountRequest {
168168
account_id: Some(proto::account::AccountId { id: account_id.to_bytes() }),
169169
block_num: Some(block_num.into()),

docs/external/src/operator/architecture.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ The builder also exposes an internal gRPC server that the RPC component uses to
7575
`GetNetworkNoteStatus`. In bundled mode this is wired automatically; in distributed mode operators must set
7676
`--ntx-builder.url` (or `MIDEN_NODE_NTX_BUILDER_URL`) on the RPC component.
7777

78+
### Foreign account calls from network notes
79+
80+
Network-account notes may use Foreign Procedure Invocation (FPI) to call procedures from another public account while
81+
the network transaction builder executes the note. When execution requests a foreign account, the builder asks the store
82+
for that account at the same reference block used for the network transaction, loads the foreign account code into the
83+
transaction executor, and passes the resulting transaction inputs to the validator. The validator then reloads the same
84+
foreign account code from the transaction inputs while re-executing the proven transaction.
85+
86+
Application developers do not import the foreign account directly when submitting a network note. Instead, they must
87+
ensure that the FPI target is a public account whose code and header are available from the store at execution time. This
88+
is the supported path for registry or AMM-style flows where a network account validates code or state commitments from
89+
another public account.
90+
91+
If the foreign account is private, missing, not yet visible at the reference block, or otherwise unavailable from the
92+
store, network note execution fails and is retried according to the builder's retry policy. The latest failure is exposed
93+
through `GetNetworkNoteStatus.last_error`, and the note is eventually discarded once the configured attempt limit is
94+
reached.
95+
7896
## Validator
7997

8098
The validator is responsible for verifying the integrity of the blockchain by signing new blocks before they can be committed.

docs/external/src/rpc.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ Returns the current lifecycle status of a network note. The status indicates whe
9595

9696
This endpoint is only available when the network transaction builder is enabled and connected. If it is not configured, the endpoint returns `UNAVAILABLE`.
9797

98+
For network notes that perform FPI into another account, `last_error` is the first place to check when the foreign
99+
account cannot be loaded. A missing, private, or not-yet-visible foreign account causes execution to fail in the network
100+
transaction builder. The note remains pending while retries are available, and the same failure is returned in
101+
`last_error` until a later attempt succeeds or the note is discarded.
102+
98103
#### Request
99104

100105
```protobuf

0 commit comments

Comments
 (0)