Skip to content

MF3-L05, L06, L07, L08, I11 : feat(nitronode): remove app registry, action allowances, and user staking#810

Merged
philanton merged 6 commits into
fix/audit-findings-finalx3from
feat/remove-aral
Jun 8, 2026
Merged

MF3-L05, L06, L07, L08, I11 : feat(nitronode): remove app registry, action allowances, and user staking#810
philanton merged 6 commits into
fix/audit-findings-finalx3from
feat/remove-aral

Conversation

@philanton
Copy link
Copy Markdown
Contributor

@philanton philanton commented Jun 3, 2026

Summary

Removes three interlinked, unused subsystems that were wired together through the action gateway. None were reachable by default (both NITRONODE_APP_REGISTRY_ENABLED and NITRONODE_ACTION_LIMITS_ENABLED defaulted to off), and none are planned.

Action allowances (rate limiting)

  • nitronode/action_gateway/ package, action_log store + model
  • core.GatedAction / core.ActionAllowance + the TransitionType / AppStateUpdateIntent .GatedAction() mappers
  • all AllowAction call sites, and the user.v1.get_action_allowances RPC method

App registry

  • nitronode/api/apps_v1/, the app store + model, pkg/app registry types (AppV1/AppInfoV1/PackAppV1)
  • apps.v1.* RPC methods, and the gated GetApp lookup in create_app_session

User staking

  • on-chain locking reactor/client/ABI (Go + TS), user_staked store + model
  • UpdateUserStaked / HandleUserLockedBalanceUpdated, LockingContractEventHandler*, UserLockedBalanceUpdatedEvent
  • LockingContractAddress across corerpcnode.v1.get_config → both SDKs

Cross-cutting cleanup

  • dependent surfaces in sdk/go, sdk/ts, sdk/ts-compat, and cerebro
  • docs/api.yaml schemas + methods, drift guards + snapshots
  • helm chart + config schema, the two feature-flag env vars
  • now-dead helpers: AppRegistryClient, MaxAppMetadataLen, AppIDV1Regex
  • new goose migration 20260603000000_drop_app_registry_staking_action_log.sql (drops apps_v1, action_log_v1, user_staked_v1; Down recreates them)

Scope: 119 files, +181 / −9507.

Notes

  • App sessions are unaffected — ApplicationID stays a plain string field (the registry lookup was gated and is now gone).
  • blockchain_config now requires channel_hub_address (a locking-only blockchain is no longer valid). Prod/sandbox blockchains.yaml have no locking entries, so no deploy config breaks.
  • sdk/mcp/content/ is gitignored (regenerated on build); not committed.

⚠️ Breaking changes

  • Removes the apps.v1.* and user.v1.get_action_allowances RPC methods.
  • Removes locking_contract_address from the node.v1.get_config response.
  • Removes the app-registry / action-allowance / on-chain locking surfaces from the Go and TypeScript SDKs → major version bump required.

Test plan

  • go build ./... / go vet ./... / go test ./...
  • sdk/ts build — 182 tests incl. RPC/ABI/public-API drift guards
  • sdk/ts-compat build + 41 tests
  • sdk/mcp typecheck + content regen
  • forge build

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed app registry functionality for application registration and management.
    • Removed action allowance system for user action tracking and limits.
    • Removed security token locking and escrow operations.
    • Removed corresponding CLI commands, API endpoints, and database tables supporting these features.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 82a7036b-3ac6-400e-b080-f39984c6d08f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removes app registry, action gateway, and security-token locking across APIs, handlers, router, DB models/migrations, stores, SDKs (TS/Go), CLI, and docs. Updates configs and event handlers accordingly, pruning related tests and types, and revalidates node/blockchain config without locking contract fields.

Changes

Surface deprecation and pruning

Layer / File(s) Summary
API contracts and router pruning
docs/api.yaml, pkg/rpc/*, nitronode/api/rpc_router.go, nitronode/api/*/handler.go
Removes apps.v1 and user.v1.get_action_allowances; updates routers/constructors and handler interfaces to drop action-gateway/app-registry.
Persistence and config cleanup
nitronode/store/database/*, nitronode/config/migrations/*, nitronode/store/memory/*
Drops apps_v1, action_log_v1, user_staked_v1 tables; removes related models/interfaces; tightens blockchain config to channel hub only.
SDK and CLI adjustments
sdk/ts*, sdk/go/*, cerebro/*
Removes app registry, action allowances, and locking methods/types/docs; aligns CLI help/completions and removes security-token commands.
Event and runtime wiring
nitronode/event_handlers/*, nitronode/runtime.go, nitronode/main.go
Removes locking event handling and initialization; focuses on ChannelHub events; updates runtime/router wiring and metrics docs.

Sequence Diagram(s)

(skipped)

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • dimast-x
  • ihsraham
  • nksazonov

Poem

A rabbit snipped old vines with cheer,
Pruned gates and locks far and near.
Channels hum, the routes run light,
SDKs slim, the docs are bright.
Hop, hop—less bark, more bite,
Clean paths gleam in dawn’s soft light.
c(•‿•)っ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/remove-aral

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
sdk/ts/src/client.ts (1)

103-208: ⚠️ Potential issue | 🟠 Major

Major version bump missing for breaking Client API removals

  • @yellow-org/sdk and @yellow-org/sdk-compat versions are still 1.3.1 (sdk/ts/package.json, sdk/ts-compat/package.json), with no version-field changes in this PR.
  • No sdk/ changesets/changelog entries were found to document the breaking removal of Client methods.

Update the packages’ major versions and add a breaking-change note documenting the removed Client surface.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sdk/ts/src/client.ts` around lines 103 - 208, The package versions and
changelogs must be updated to reflect breaking changes from removed Client APIs:
bump the major version in sdk/ts/package.json and sdk/ts-compat/package.json
(e.g., 1.x -> 2.0.0) and add a changeset or changelog entry under sdk/
documenting the breaking-change that lists the removed Client surface (reference
the Client class and its public API such as Client.create and any removed
methods) so downstream consumers know to migrate; ensure the changeset file
includes a "major" bump and a clear note describing which Client methods were
removed and recommended migration steps.
cerebro/operator.go (1)

56-57: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle session raw-signer construction errors in Operator.buildStateSigner (cerebro/operator.go:56-57).

buildStateSigner discards the error from sign.NewEthereumRawSigner(skPrivateKey) and then dereferences sessionRawSigner to print the address. NewEthereumRawSigner returns (nil, err) when the private key can’t be parsed, so this can crash the CLI on startup/reconnect.

Suggested fix
-		sessionRawSigner, _ := sign.NewEthereumRawSigner(skPrivateKey)
+		sessionRawSigner, err := sign.NewEthereumRawSigner(skPrivateKey)
+		if err != nil {
+			return nil, fmt.Errorf("failed to create session key raw signer: %w", err)
+		}
 		fmt.Printf("INFO: Using session key for state signing: %s\n", sessionRawSigner.PublicKey().Address().String())
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cerebro/operator.go` around lines 56 - 57, In buildStateSigner, don't ignore
the error from sign.NewEthereumRawSigner(skPrivateKey); capture its second
return value, check if err != nil and return or propagate a descriptive error
(or log and return) instead of dereferencing sessionRawSigner; update the call
site to handle the returned error if needed and ensure the log that prints
sessionRawSigner.PublicKey().Address() is only executed after a successful
signer construction.
nitronode/api/rpc_router.go (1)

28-51: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add Go doc comments for the exported RPC router API (types, constructor, and exported fields)

nitronode/api/rpc_router.go has no Go doc comments for the exported RPCRouter, RPCRouterConfig, and NewRPCRouter, and it also lacks doc comments for all exported fields (RPCRouter.Node and every exported field in RPCRouterConfig).
Add // ... comments for each exported name to comply with the repo’s Go rules for exported identifiers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nitronode/api/rpc_router.go` around lines 28 - 51, Add Go doc comments for
all exported RPC router API symbols: document the RPCRouter type, the
RPCRouterConfig type and each of its exported fields (NodeVersion, MinChallenge,
MaxChallenge, MaxParticipants, MaxSessionDataLen, MaxRebalanceSignedUpdates,
MaxSessionKeyIDs, MaxSessionKeysPerUser, RateLimitPerSec, RateLimitBurst), the
NewRPCRouter constructor, and the RPCRouter.Node exported field. Use standard Go
godoc style: a single-line comment starting with the exact identifier name
(e.g., "// RPCRouter ...") describing its purpose, and similarly comment each
exported field (e.g., "// RPCRouterConfig.NodeVersion ...") so all exported
identifiers in rpc_router.go have top-level doc comments.
🧹 Nitpick comments (1)
nitronode/store/memory/blockchain_config_test.go (1)

17-53: ⚡ Quick win

Add an explicit missing-channel_hub_address case.

This update covers malformed channel_hub_address, but not the new required-field path. verifyBlockchainsConfig now fails fast when the address is empty, and that branch is still untested.

Suggested test addition
 		{
+			name: "missing channel hub address",
+			cfg: BlockchainsConfig{
+				Blockchains: []BlockchainConfig{
+					{
+						ID:   1,
+						Name: "ethereum",
+					},
+				},
+			},
+			expectedErrorStr: "blockchain 'ethereum' must specify channel_hub_address",
+		},
+		{
 			name: "invalid channel hub address",
 			cfg: BlockchainsConfig{
 				Blockchains: []BlockchainConfig{
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nitronode/store/memory/blockchain_config_test.go` around lines 17 - 53, Add a
new test case in nitronode/store/memory/blockchain_config_test.go that exercises
the fast-fail path when ChannelHubAddress is empty: create a BlockchainsConfig
with at least one BlockchainConfig having ChannelHubAddress set to "" (or
omitted), set expectedErrorStr to match the error message from
verifyBlockchainsConfig, and assert that verifyBlockchainsConfig (or the code
path that loads/validates BlockchainsConfig) returns the expected error;
reference the BlockchainsConfig and BlockchainConfig structs and the
verifyBlockchainsConfig validation function when locating where to add the case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/README.md`:
- Line 39: The README entry for user_v1 incorrectly labels the surface as only
"balances"; update the documentation to accurately list all RPCs exposed by
user_v1 (e.g., balances and transactions) by referencing the actual RPC names
such as user.v1.get_transactions in nitronode/api/rpc_router.go and any other
handlers in that router; replace or expand the folder comment "User endpoints
(balances)" to something like "User endpoints (balances, transactions, ...)" and
enumerate the specific RPCs or behaviors exposed so the docs match the code.

In
`@nitronode/config/migrations/postgres/20260603000000_drop_app_registry_staking_action_log.sql`:
- Around line 6-8: The migration drops production tables apps_v1, action_log_v1,
and user_staked_v1 which destroys data and prevents safe rollbacks; update the
migration (20260603000000_drop_app_registry_staking_action_log.sql) to first
preserve data by renaming or archiving each table (e.g., ALTER TABLE ... RENAME
TO ..._archive or CREATE TABLE ..._backup AS SELECT * FROM ...), include any
indexes/constraints copy or notes about them, and only then drop the originals,
or instead gate the DROP behind a documented/manual data-migration step with
clear instructions and a reversible Down migration that restores from the
archive/backup tables so rollbacks are non-destructive.

In `@nitronode/store/database/testing.go`:
- Line 102: The Postgres test AutoMigrate call in testing.go is missing
AppParticipantV1, causing divergent schemas between SQLite and Postgres; update
the AutoMigrate invocation (the database.AutoMigrate call) to include
&AppParticipantV1{} alongside the other model types so the Postgres test DB
migrates the same models as the SQLite setup and restores parity for app-session
tests.

In `@sdk/go/examples/app_sessions/lifecycle.go`:
- Around line 146-148: The example still fabricates an owner-approval step
(building an ownerSig from wallet1) in "Session 2" despite the comment that app
IDs need no prior registration; remove the owner-approval logic and any ownerSig
construction/usage in the Session 2 flow (and the duplicate block around the
later rows 264-270) so the session creation demonstrates registration-free app
IDs; update the surrounding comments to match the simplified TS example and
ensure session creation uses only the arbitrary suffix-based app ID generation
(variable suffix) without referencing wallet1 or ownerSig.

---

Outside diff comments:
In `@cerebro/operator.go`:
- Around line 56-57: In buildStateSigner, don't ignore the error from
sign.NewEthereumRawSigner(skPrivateKey); capture its second return value, check
if err != nil and return or propagate a descriptive error (or log and return)
instead of dereferencing sessionRawSigner; update the call site to handle the
returned error if needed and ensure the log that prints
sessionRawSigner.PublicKey().Address() is only executed after a successful
signer construction.

In `@nitronode/api/rpc_router.go`:
- Around line 28-51: Add Go doc comments for all exported RPC router API
symbols: document the RPCRouter type, the RPCRouterConfig type and each of its
exported fields (NodeVersion, MinChallenge, MaxChallenge, MaxParticipants,
MaxSessionDataLen, MaxRebalanceSignedUpdates, MaxSessionKeyIDs,
MaxSessionKeysPerUser, RateLimitPerSec, RateLimitBurst), the NewRPCRouter
constructor, and the RPCRouter.Node exported field. Use standard Go godoc style:
a single-line comment starting with the exact identifier name (e.g., "//
RPCRouter ...") describing its purpose, and similarly comment each exported
field (e.g., "// RPCRouterConfig.NodeVersion ...") so all exported identifiers
in rpc_router.go have top-level doc comments.

In `@sdk/ts/src/client.ts`:
- Around line 103-208: The package versions and changelogs must be updated to
reflect breaking changes from removed Client APIs: bump the major version in
sdk/ts/package.json and sdk/ts-compat/package.json (e.g., 1.x -> 2.0.0) and add
a changeset or changelog entry under sdk/ documenting the breaking-change that
lists the removed Client surface (reference the Client class and its public API
such as Client.create and any removed methods) so downstream consumers know to
migrate; ensure the changeset file includes a "major" bump and a clear note
describing which Client methods were removed and recommended migration steps.

---

Nitpick comments:
In `@nitronode/store/memory/blockchain_config_test.go`:
- Around line 17-53: Add a new test case in
nitronode/store/memory/blockchain_config_test.go that exercises the fast-fail
path when ChannelHubAddress is empty: create a BlockchainsConfig with at least
one BlockchainConfig having ChannelHubAddress set to "" (or omitted), set
expectedErrorStr to match the error message from verifyBlockchainsConfig, and
assert that verifyBlockchainsConfig (or the code path that loads/validates
BlockchainsConfig) returns the expected error; reference the BlockchainsConfig
and BlockchainConfig structs and the verifyBlockchainsConfig validation function
when locating where to add the case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 610b05b3-70ba-4d52-99c2-0f64ad2ac8bb

📥 Commits

Reviewing files that changed from the base of the PR and between 0c46c9e and a9bbca9.

⛔ Files ignored due to path filters (2)
  • sdk/ts-compat/test/unit/__snapshots__/public-api-drift.test.ts.snap is excluded by !**/*.snap
  • sdk/ts/test/unit/__snapshots__/public-api-drift.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (118)
  • cerebro/README.md
  • cerebro/commands.go
  • cerebro/operator.go
  • docs/README.md
  • docs/api.yaml
  • nitronode/action_gateway/action_gateway.go
  • nitronode/action_gateway/action_gateway_test.go
  • nitronode/action_gateway/interface.go
  • nitronode/action_gateway/permissive_action_allower.go
  • nitronode/api/app_session_v1/create_app_session.go
  • nitronode/api/app_session_v1/create_app_session_test.go
  • nitronode/api/app_session_v1/handler.go
  • nitronode/api/app_session_v1/interface.go
  • nitronode/api/app_session_v1/rebalance_app_sessions.go
  • nitronode/api/app_session_v1/rebalance_app_sessions_test.go
  • nitronode/api/app_session_v1/submit_app_state.go
  • nitronode/api/app_session_v1/submit_app_state_test.go
  • nitronode/api/app_session_v1/submit_deposit_state.go
  • nitronode/api/app_session_v1/submit_deposit_state_test.go
  • nitronode/api/app_session_v1/testing.go
  • nitronode/api/apps_v1/get_apps.go
  • nitronode/api/apps_v1/get_apps_test.go
  • nitronode/api/apps_v1/handler.go
  • nitronode/api/apps_v1/interface.go
  • nitronode/api/apps_v1/submit_app_version.go
  • nitronode/api/apps_v1/submit_app_version_test.go
  • nitronode/api/apps_v1/testing.go
  • nitronode/api/channel_v1/get_channels_test.go
  • nitronode/api/channel_v1/get_escrow_channel_test.go
  • nitronode/api/channel_v1/get_home_channel_test.go
  • nitronode/api/channel_v1/get_latest_state_test.go
  • nitronode/api/channel_v1/handler.go
  • nitronode/api/channel_v1/interface.go
  • nitronode/api/channel_v1/request_creation.go
  • nitronode/api/channel_v1/request_creation_test.go
  • nitronode/api/channel_v1/submit_state.go
  • nitronode/api/channel_v1/submit_state_test.go
  • nitronode/api/channel_v1/testing.go
  • nitronode/api/node_v1/utils.go
  • nitronode/api/rpc_router.go
  • nitronode/api/user_v1/get_action_allowances.go
  • nitronode/api/user_v1/get_action_allowances_test.go
  • nitronode/api/user_v1/handler.go
  • nitronode/api/user_v1/interface.go
  • nitronode/api/user_v1/testing.go
  • nitronode/api/user_v1/utils.go
  • nitronode/chart/README.md
  • nitronode/chart/templates/configmap.yaml
  • nitronode/chart/values.yaml
  • nitronode/config/migrations/postgres/20260603000000_drop_app_registry_staking_action_log.sql
  • nitronode/config/schemas/action_gateway_schema.yaml
  • nitronode/event_handlers/service.go
  • nitronode/event_handlers/service_test.go
  • nitronode/event_handlers/testing.go
  • nitronode/main.go
  • nitronode/metrics/interface.go
  • nitronode/runtime.go
  • nitronode/store/database/action_log.go
  • nitronode/store/database/action_log_test.go
  • nitronode/store/database/app.go
  • nitronode/store/database/app_test.go
  • nitronode/store/database/channel_test.go
  • nitronode/store/database/database.go
  • nitronode/store/database/db_store.go
  • nitronode/store/database/interface.go
  • nitronode/store/database/lifespan_metric_test.go
  • nitronode/store/database/state.go
  • nitronode/store/database/testing.go
  • nitronode/store/database/user_staked.go
  • nitronode/store/memory/blockchain_config.go
  • nitronode/store/memory/blockchain_config_test.go
  • nitronode/store/memory/memory_store.go
  • pkg/app/app_session_v1.go
  • pkg/app/app_v1.go
  • pkg/blockchain/evm/app_registry_abi.go
  • pkg/blockchain/evm/channel_hub_reactor.go
  • pkg/blockchain/evm/channel_hub_reactor_test.go
  • pkg/blockchain/evm/init.go
  • pkg/blockchain/evm/locking_client.go
  • pkg/blockchain/evm/locking_reactor.go
  • pkg/blockchain/evm/locking_reactor_test.go
  • pkg/core/event.go
  • pkg/core/interface.go
  • pkg/core/types.go
  • pkg/log/noop_logger.go
  • pkg/rpc/api.go
  • pkg/rpc/client.go
  • pkg/rpc/client_test.go
  • pkg/rpc/connection_hub.go
  • pkg/rpc/methods.go
  • pkg/rpc/types.go
  • pkg/sign/mock_signer_test.go
  • sdk/PROTOCOL_DRIFT_GUARDS.md
  • sdk/go/README.md
  • sdk/go/app_registry.go
  • sdk/go/client.go
  • sdk/go/examples/app_sessions/lifecycle.go
  • sdk/go/user.go
  • sdk/go/utils.go
  • sdk/mcp/src/index.ts
  • sdk/ts-compat/README.md
  • sdk/ts-compat/src/client.ts
  • sdk/ts-compat/test/unit/client.test.ts
  • sdk/ts/README.md
  • sdk/ts/examples/app_sessions/lifecycle.ts
  • sdk/ts/src/app/packing.ts
  • sdk/ts/src/blockchain/evm/app_registry_abi.ts
  • sdk/ts/src/blockchain/evm/index.ts
  • sdk/ts/src/blockchain/evm/locking_client.ts
  • sdk/ts/src/client.ts
  • sdk/ts/src/core/types.ts
  • sdk/ts/src/rpc/api.ts
  • sdk/ts/src/rpc/client.ts
  • sdk/ts/src/rpc/methods.ts
  • sdk/ts/src/rpc/types.ts
  • sdk/ts/src/utils.ts
  • sdk/ts/test/unit/abi-drift.test.ts
  • sdk/ts/test/unit/rpc-drift.test.ts
💤 Files with no reviewable changes (86)
  • nitronode/action_gateway/interface.go
  • nitronode/api/apps_v1/submit_app_version.go
  • nitronode/api/node_v1/utils.go
  • nitronode/config/schemas/action_gateway_schema.yaml
  • nitronode/store/database/app.go
  • sdk/ts/src/blockchain/evm/app_registry_abi.ts
  • pkg/blockchain/evm/channel_hub_reactor_test.go
  • nitronode/store/database/app_test.go
  • nitronode/api/apps_v1/handler.go
  • nitronode/api/user_v1/get_action_allowances.go
  • nitronode/store/database/action_log.go
  • nitronode/api/apps_v1/interface.go
  • nitronode/api/apps_v1/submit_app_version_test.go
  • sdk/go/app_registry.go
  • nitronode/api/user_v1/get_action_allowances_test.go
  • nitronode/store/database/user_staked.go
  • sdk/go/utils.go
  • nitronode/action_gateway/action_gateway_test.go
  • nitronode/api/channel_v1/get_home_channel_test.go
  • nitronode/store/database/action_log_test.go
  • sdk/ts/src/app/packing.ts
  • nitronode/api/channel_v1/handler.go
  • nitronode/store/database/state.go
  • nitronode/api/channel_v1/get_escrow_channel_test.go
  • pkg/blockchain/evm/init.go
  • nitronode/action_gateway/action_gateway.go
  • nitronode/api/app_session_v1/handler.go
  • nitronode/api/apps_v1/get_apps_test.go
  • sdk/go/user.go
  • sdk/ts/src/blockchain/evm/locking_client.ts
  • nitronode/chart/README.md
  • sdk/ts/src/rpc/client.ts
  • nitronode/chart/templates/configmap.yaml
  • pkg/blockchain/evm/locking_reactor_test.go
  • nitronode/action_gateway/permissive_action_allower.go
  • sdk/ts/src/core/types.ts
  • nitronode/api/apps_v1/testing.go
  • docs/api.yaml
  • sdk/go/README.md
  • nitronode/api/apps_v1/get_apps.go
  • nitronode/store/database/database.go
  • sdk/ts-compat/test/unit/client.test.ts
  • nitronode/api/app_session_v1/create_app_session.go
  • sdk/ts/README.md
  • pkg/core/event.go
  • nitronode/api/user_v1/testing.go
  • nitronode/api/channel_v1/testing.go
  • sdk/ts/test/unit/abi-drift.test.ts
  • nitronode/api/channel_v1/get_channels_test.go
  • pkg/app/app_session_v1.go
  • pkg/rpc/client_test.go
  • pkg/blockchain/evm/channel_hub_reactor.go
  • nitronode/api/channel_v1/request_creation.go
  • nitronode/api/app_session_v1/submit_deposit_state.go
  • nitronode/chart/values.yaml
  • pkg/blockchain/evm/locking_client.go
  • nitronode/api/app_session_v1/rebalance_app_sessions.go
  • pkg/blockchain/evm/locking_reactor.go
  • nitronode/store/database/channel_test.go
  • pkg/rpc/connection_hub.go
  • nitronode/api/channel_v1/get_latest_state_test.go
  • sdk/ts/src/rpc/api.ts
  • sdk/ts/src/blockchain/evm/index.ts
  • pkg/rpc/api.go
  • nitronode/api/app_session_v1/submit_app_state.go
  • sdk/ts/src/rpc/types.ts
  • nitronode/api/user_v1/interface.go
  • pkg/rpc/client.go
  • pkg/app/app_v1.go
  • nitronode/event_handlers/testing.go
  • pkg/core/interface.go
  • pkg/rpc/types.go
  • nitronode/store/database/interface.go
  • nitronode/api/channel_v1/interface.go
  • nitronode/runtime.go
  • sdk/ts/src/rpc/methods.ts
  • nitronode/api/channel_v1/submit_state_test.go
  • sdk/ts/test/unit/rpc-drift.test.ts
  • nitronode/event_handlers/service.go
  • nitronode/api/app_session_v1/interface.go
  • nitronode/api/app_session_v1/rebalance_app_sessions_test.go
  • sdk/ts-compat/src/client.ts
  • nitronode/api/app_session_v1/testing.go
  • nitronode/event_handlers/service_test.go
  • nitronode/api/app_session_v1/create_app_session_test.go
  • nitronode/api/app_session_v1/submit_app_state_test.go

Comment thread docs/README.md Outdated
Comment thread nitronode/store/database/testing.go Outdated
Comment thread sdk/go/examples/app_sessions/lifecycle.go
@philanton philanton changed the base branch from main to fix/audit-findings-finalx3 June 3, 2026 10:58
Comment thread docs/api.yaml
type: string
description: Session-key holder's signature over the same packed state (which already binds user_address) proving possession of the key being registered. Required on every submit to prevent registration of keys the submitter does not control.

- app:
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.

The registry schema is removed here, which matches the runtime fix. One follow-up in the same API spec: the remaining app_definition.application_id and create_app_session docs still describe registry-backed apps and owner approval (docs/api.yaml:162, docs/api.yaml:767, docs/api.yaml:797 on the PR head).

Could we update those descriptions/errors to match the new behavior? Otherwise the public API spec and MCP docs will keep telling integrators to use registry/owner approval that the node no longer uses.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, good catch. Updated in 9c211c7 — dropped the registry/owner-approval wording from app_definition.application_id and create_app_session, and removed the now-dead owner_sig field plus the application_not_registered/owner_sig_required/invalid_owner_signature errors since the runtime no longer emits them.

Copy link
Copy Markdown
Collaborator

@ihsraham ihsraham left a comment

Choose a reason for hiding this comment

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

approved for I-06/L-08/L-07/L-06/L-05 runtime closure. the affected runtime surfaces are gone: action allowances, action-gateway app registration, staking/locking authorization, and registry-gated app-session creation are no longer reachable.

i left one API-spec cleanup note for stale registry/owner-approval wording. treating the SDK/MCP version bump as a release follow-up per the plan.

@philanton
Copy link
Copy Markdown
Contributor Author

Re the out-of-diff bot notes:

  1. cerebro/operator.go discarding the NewEthereumRawSigner error — real, fixed in 9c211c7 (it could nil-deref on a bad key). Pre-existing, but cheap to clean up while here;
  2. SDK major version bump + changeset — agree it's needed, but as @ihsraham said we're handling the version bump as a release follow-up per the plan, so leaving it out of this PR;
  3. godoc on RPCRouter and the missing-channel_hub_address test case — nitpicks, skipping for now.

philanton and others added 2 commits June 4, 2026 17:31
…aking

Remove three interlinked, unused subsystems wired together through the
action gateway:

- Action allowances (rate limiting): action_gateway package, action_log
  store + model, core.GatedAction/ActionAllowance and the TransitionType/
  AppStateUpdateIntent .GatedAction() mappers, all AllowAction call sites,
  and the user.v1.get_action_allowances RPC method.
- App registry: api/apps_v1, the app store + model, pkg/app registry types
  (AppV1/AppInfoV1/PackAppV1), apps.v1.* RPC methods, and the gated GetApp
  lookup in create_app_session (app sessions keep ApplicationID as a plain
  string field).
- User staking: the on-chain locking reactor/client/ABI (Go + TS),
  user_staked store + model, UpdateUserStaked/HandleUserLockedBalanceUpdated,
  the LockingContractEventHandler interfaces, UserLockedBalanceUpdatedEvent,
  and LockingContractAddress across core -> rpc -> node.v1.get_config -> SDKs.

Also drops the dependent SDK surfaces (sdk/go, sdk/ts, ts-compat), cerebro
commands, docs/api.yaml schemas and methods, drift guards + snapshots, chart
and config schema, the NITRONODE_ACTION_LIMITS_ENABLED /
NITRONODE_APP_REGISTRY_ENABLED flags, and now-dead helpers
(AppRegistryClient, MaxAppMetadataLen, AppIDV1Regex). Adds a goose migration
that drops apps_v1, action_log_v1, and user_staked_v1.

BREAKING CHANGE: removes the apps.v1 and user.v1.get_action_allowances RPC
methods, the locking_contract_address config field from node.v1.get_config,
and the app-registry / action-allowance / on-chain locking surfaces from the
Go and TypeScript SDKs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- docs/api.yaml: drop stale registry/owner-approval wording from
  app_definition and create_app_session; remove obsolete owner_sig
  field and registry-related errors (no longer emitted by runtime)
- docs/README.md: user_v1 exposes transactions as well as balances
- store/database/testing.go: migrate AppParticipantV1 in the Postgres
  test schema to match SQLite (fixes backend schema divergence)
- cerebro/operator.go: handle NewEthereumRawSigner error instead of
  discarding it and dereferencing a possibly-nil signer

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nksazonov nksazonov changed the title feat(nitronode)!: remove app registry, action allowances, and user staking MF3-L05, L06, L07, L08 : feat(nitronode)!: remove app registry, action allowances, and user staking Jun 4, 2026
@nksazonov nksazonov changed the title MF3-L05, L06, L07, L08 : feat(nitronode)!: remove app registry, action allowances, and user staking MF3-L05, L06, L07, L08, I11 : feat(nitronode)!: remove app registry, action allowances, and user staking Jun 4, 2026
@nksazonov nksazonov changed the title MF3-L05, L06, L07, L08, I11 : feat(nitronode)!: remove app registry, action allowances, and user staking MF3-L05, L06, L07, L08, I11 : feat(nitronode): remove app registry, action allowances, and user staking Jun 4, 2026
Copy link
Copy Markdown
Contributor

@nksazonov nksazonov left a comment

Choose a reason for hiding this comment

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

Clean removal that correctly strips three interlinked subsystems without touching unrelated code — but the nitronode/api/app_session_v1 test package does not compile, so go test ./... fails.

Blocker: go test ./... fails — github.com/layer-3/nitrolite/nitronode/api/app_session_v1 does not build due to stale references in four test files (all 22 other packages pass).


[CRITICAL] Test package fails to compile

Four test files still reference types and constructor parameters removed by this PR:

  • create_app_session_test.go lines 859–870 and 933–944: NewHandler(...) called with old signature (extra &MockActionGateway{} + true args); app.AppInfoV1 / app.AppV1 used at lines 901–902.
  • rebalance_app_sessions_test.go line 1196: &MockActionGateway{} passed to NewHandler.
  • submit_app_state_test.go line 1956: &MockActionGateway{} passed to NewHandler.
  • submit_deposit_state_test.go lines 833–843: struct literal sets actionGateway: and appRegistryEnabled: fields, both removed from Handler.

These tests guard the uint8 quorum overflow fix (MF3-C01) and their NewHandler/Handler setup was not updated when the action gateway and app registry flag were removed. Each call site needs the &MockActionGateway{} arg, the appRegistryEnabled bool arg (or struct field), and any GetApp mock expectations removed.

-- +goose Down

-- Application registry
CREATE TABLE apps_v1 (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Down CREATE TABLE statements have no DROP TABLE IF EXISTS guard. If goose down is re-run on a partially-rolled-back database (e.g. during rollback debugging), each statement will fail with "relation already exists."

Add DROP TABLE IF EXISTS <table>; before each CREATE TABLE in the Down block, or use CREATE TABLE IF NOT EXISTS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, good catch. Fixed in fe70570 — added DROP TABLE IF EXISTS before each CREATE TABLE in the Down block.

philanton and others added 2 commits June 5, 2026 12:33
… feat/remove-aral

# Conflicts:
#	nitronode/api/apps_v1/get_apps_test.go
#	nitronode/store/database/app.go
…uard migration Down

The rebase onto the audit-fix base reintroduced uint8 overflow/quorum tests
(MF3-M04) that were authored against the pre-removal NewHandler signature, so
the app_session_v1 test build failed. Port those calls to the current 12-arg
signature (drop the action-gateway arg, the appRegistryEnabled bool, and the now
-dead GetApp/AppInfoV1 registry expectations).

Also add DROP TABLE IF EXISTS guards before each CREATE TABLE in the drop-app
-registry migration's Down block, so re-running `goose down` after a partial
rollback no longer fails with "relation already exists" (per @nksazonov).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@philanton
Copy link
Copy Markdown
Contributor Author

Merged latest fix/audit-findings-finalx3 in. Heads up — the rebase pulled in the MF3-M04 uint8 overflow/quorum tests, which were written against the old NewHandler signature, so the app_session_v1 test build was failing. Ported those calls in fe70570: dropped the action-gateway arg, the appRegistryEnabled bool, and the now-dead GetApp/AppInfoV1 mock expectations. go test ./nitronode/... ./pkg/core/... is green again.

… feat/remove-aral

# Conflicts:
#	nitronode/runtime.go
#	nitronode/store/database/app.go
philanton pushed a commit that referenced this pull request Jun 5, 2026
## Summary

- Refresh `sdk/mcp/package-lock.json` so the MCP SDK dependency tree
resolves `hono` 4.12.23 instead of vulnerable 4.12.18.
- Fix the `Publish SDK MCP` workflow failure in the `Audit production
dependencies` step, where `npm audit --omit=dev --audit-level=moderate`
reports Hono moderate advisories.

## Root cause

The PR #810 job failed because `sdk/mcp/package-lock.json` pinned
production dependency `hono` at 4.12.18, which matches the vulnerable
`<=4.12.20` advisory range. The package manifest already allows a
patched Hono through `@modelcontextprotocol/sdk`; the lockfile needed to
be refreshed.

## Validation

- `npm ci`
- `npm audit --omit=dev --audit-level=moderate`
- `npm run typecheck`
- `npm run build`
- `npm run verify:package -- pack.json`
- Local packed MCP server smoke test equivalent to the workflow smoke
job
… feat/remove-aral

# Conflicts:
#	nitronode/api/app_session_v1/create_app_session_test.go
#	nitronode/api/app_session_v1/rebalance_app_sessions.go
#	nitronode/api/app_session_v1/rebalance_app_sessions_test.go
#	nitronode/api/app_session_v1/submit_app_state_test.go
#	nitronode/api/app_session_v1/submit_deposit_state_test.go
#	nitronode/api/rpc_router.go
#	nitronode/main.go
#	sdk/go/examples/app_sessions/lifecycle.go
#	sdk/ts/examples/app_sessions/lifecycle.ts
#	sdk/ts/src/app/packing.ts
#	sdk/ts/test/unit/__snapshots__/public-api-drift.test.ts.snap
@philanton philanton merged commit f7eec19 into fix/audit-findings-finalx3 Jun 8, 2026
7 checks passed
@philanton philanton deleted the feat/remove-aral branch June 8, 2026 08:31
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