Commit d979a26
authored
refactor: move registerContractFunctionSignatures to the node debug API (#24066)
Fixes A-1220
## Why
`node.registerContractFunctionSignatures` was an always-on,
unauthenticated write on the main `AztecNode` JSON-RPC surface. It
populates a per-node, in-memory, non-gossiped selector→name map used
only to name public-execution stack traces, so it has no business on a
prod node's public API (anyone can spam it up to the cap, and you'd have
to keep talking to the same node for it to mean anything). Decoding
traces should be a client concern.
## What
Relocate the method from the always-on `AztecNode` interface to the
existing, gated `AztecNodeDebug` interface (served under the
`nodeDebug_` namespace, only mounted when the node runs with debug
endpoints enabled — always on in the in-process sandbox, off by default
on standalone nodes). The node-side read path (`getDebugFunctionName` →
AVM trace naming) is unchanged; only the RPC write moves.
The PXE now calls it through an **optional** `nodeDebug` client and
skips registration entirely when the node does not expose the debug API.
PXE-side simulation errors keep named traces regardless, via the
existing ABI-based enrichment in `pxe/src/error_enriching.ts`.
- **stdlib**: removed `registerContractFunctionSignatures` from
`AztecNode` + `AztecNodeApiSchema`; added it (and the length/count caps)
to `AztecNodeDebug` + `AztecNodeDebugApiSchema`.
- **aztec-node**: server impl unchanged — `AztecNodeService` already
implements `AztecNodeDebug`, so the method now satisfies that interface
and is served under `nodeDebug_`.
- **pxe**: optional `nodeDebug?: AztecNodeDebug` on
`PXECreateArgs`/constructor; both registration call sites become
`this.nodeDebug?.registerContractFunctionSignatures(...)`. Threaded
`options.nodeDebug` through all three `createPXE` entrypoints (option A
— explicit injection).
- **e2e**: wired `nodeDebug` in `end-to-end/src/fixtures/setup.ts` for
both PXE-creation paths — `setup()` passes the in-process node service
directly; `setupPXEAndGetWallet()` passes it via an `isAztecNodeDebug`
type guard (one caller types its node loosely).
- **tests**: moved the schema round-trip case from the node interface
test to the debug interface test; retargeted the PXE registration tests
to the `nodeDebug` mock; updated the `node_rpc_perf` benchmark.
- **docs**: dropped the moved method from the generated node API
reference (the generator only documents `node_`/`nodeAdmin_`), and added
a migration note.
## Breaking change
`node_registerContractFunctionSignatures` is removed from the main node
RPC. Callers must use `nodeDebug_registerContractFunctionSignatures`
against a debug-enabled node. See the migration note.
## Verification
Local build could not be run here: the workspace is a cold checkout
(noir submodule packages absent, no Rust/Docker), so `yarn
install`/`yarn build` cannot bootstrap. The change is a contained
TypeScript interface relocation + optional-client wiring; relying on CI
for the full build/lint/test. A follow-up could wire
`createAztecNodeDebugClient(nodeUrl)` into the URL-based PXE creators
(bot/embedded wallet) if named traces are wanted against a debug-enabled
remote node.
---
*Created by
[claudebox](https://claudebox.work/v2/sessions/b8d3c4fab6c0225a) ·
group: `slackbot`*1 parent 96d47a0 commit d979a26
17 files changed
Lines changed: 78 additions & 39 deletions
File tree
- docs
- docs-developers/docs/resources
- scripts/node_api_reference_generation
- yarn-project
- end-to-end/src
- bench
- fixtures
- pxe/src
- entrypoints
- client
- bundle
- lazy
- server
- stdlib/src/interfaces
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
754 | | - | |
| 754 | + | |
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
149 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| |||
609 | 615 | | |
610 | 616 | | |
611 | 617 | | |
| 618 | + | |
| 619 | + | |
612 | 620 | | |
613 | 621 | | |
614 | 622 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
0 commit comments