MF3-L05, L06, L07, L08, I11 : feat(nitronode): remove app registry, action allowances, and user staking#810
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughRemoves 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. ChangesSurface deprecation and pruning
Sequence Diagram(s)(skipped) Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
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 | 🟠 MajorMajor version bump missing for breaking
ClientAPI removals
@yellow-org/sdkand@yellow-org/sdk-compatversions are still1.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 ofClientmethods.Update the packages’ major versions and add a breaking-change note documenting the removed
Clientsurface.🤖 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 winHandle session raw-signer construction errors in
Operator.buildStateSigner(cerebro/operator.go:56-57).
buildStateSignerdiscards the error fromsign.NewEthereumRawSigner(skPrivateKey)and then dereferencessessionRawSignerto print the address.NewEthereumRawSignerreturns(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 winAdd Go doc comments for the exported RPC router API (types, constructor, and exported fields)
nitronode/api/rpc_router.gohas no Go doc comments for the exportedRPCRouter,RPCRouterConfig, andNewRPCRouter, and it also lacks doc comments for all exported fields (RPCRouter.Nodeand every exported field inRPCRouterConfig).
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 winAdd an explicit missing-
channel_hub_addresscase.This update covers malformed
channel_hub_address, but not the new required-field path.verifyBlockchainsConfignow 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
⛔ Files ignored due to path filters (2)
sdk/ts-compat/test/unit/__snapshots__/public-api-drift.test.ts.snapis excluded by!**/*.snapsdk/ts/test/unit/__snapshots__/public-api-drift.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (118)
cerebro/README.mdcerebro/commands.gocerebro/operator.godocs/README.mddocs/api.yamlnitronode/action_gateway/action_gateway.gonitronode/action_gateway/action_gateway_test.gonitronode/action_gateway/interface.gonitronode/action_gateway/permissive_action_allower.gonitronode/api/app_session_v1/create_app_session.gonitronode/api/app_session_v1/create_app_session_test.gonitronode/api/app_session_v1/handler.gonitronode/api/app_session_v1/interface.gonitronode/api/app_session_v1/rebalance_app_sessions.gonitronode/api/app_session_v1/rebalance_app_sessions_test.gonitronode/api/app_session_v1/submit_app_state.gonitronode/api/app_session_v1/submit_app_state_test.gonitronode/api/app_session_v1/submit_deposit_state.gonitronode/api/app_session_v1/submit_deposit_state_test.gonitronode/api/app_session_v1/testing.gonitronode/api/apps_v1/get_apps.gonitronode/api/apps_v1/get_apps_test.gonitronode/api/apps_v1/handler.gonitronode/api/apps_v1/interface.gonitronode/api/apps_v1/submit_app_version.gonitronode/api/apps_v1/submit_app_version_test.gonitronode/api/apps_v1/testing.gonitronode/api/channel_v1/get_channels_test.gonitronode/api/channel_v1/get_escrow_channel_test.gonitronode/api/channel_v1/get_home_channel_test.gonitronode/api/channel_v1/get_latest_state_test.gonitronode/api/channel_v1/handler.gonitronode/api/channel_v1/interface.gonitronode/api/channel_v1/request_creation.gonitronode/api/channel_v1/request_creation_test.gonitronode/api/channel_v1/submit_state.gonitronode/api/channel_v1/submit_state_test.gonitronode/api/channel_v1/testing.gonitronode/api/node_v1/utils.gonitronode/api/rpc_router.gonitronode/api/user_v1/get_action_allowances.gonitronode/api/user_v1/get_action_allowances_test.gonitronode/api/user_v1/handler.gonitronode/api/user_v1/interface.gonitronode/api/user_v1/testing.gonitronode/api/user_v1/utils.gonitronode/chart/README.mdnitronode/chart/templates/configmap.yamlnitronode/chart/values.yamlnitronode/config/migrations/postgres/20260603000000_drop_app_registry_staking_action_log.sqlnitronode/config/schemas/action_gateway_schema.yamlnitronode/event_handlers/service.gonitronode/event_handlers/service_test.gonitronode/event_handlers/testing.gonitronode/main.gonitronode/metrics/interface.gonitronode/runtime.gonitronode/store/database/action_log.gonitronode/store/database/action_log_test.gonitronode/store/database/app.gonitronode/store/database/app_test.gonitronode/store/database/channel_test.gonitronode/store/database/database.gonitronode/store/database/db_store.gonitronode/store/database/interface.gonitronode/store/database/lifespan_metric_test.gonitronode/store/database/state.gonitronode/store/database/testing.gonitronode/store/database/user_staked.gonitronode/store/memory/blockchain_config.gonitronode/store/memory/blockchain_config_test.gonitronode/store/memory/memory_store.gopkg/app/app_session_v1.gopkg/app/app_v1.gopkg/blockchain/evm/app_registry_abi.gopkg/blockchain/evm/channel_hub_reactor.gopkg/blockchain/evm/channel_hub_reactor_test.gopkg/blockchain/evm/init.gopkg/blockchain/evm/locking_client.gopkg/blockchain/evm/locking_reactor.gopkg/blockchain/evm/locking_reactor_test.gopkg/core/event.gopkg/core/interface.gopkg/core/types.gopkg/log/noop_logger.gopkg/rpc/api.gopkg/rpc/client.gopkg/rpc/client_test.gopkg/rpc/connection_hub.gopkg/rpc/methods.gopkg/rpc/types.gopkg/sign/mock_signer_test.gosdk/PROTOCOL_DRIFT_GUARDS.mdsdk/go/README.mdsdk/go/app_registry.gosdk/go/client.gosdk/go/examples/app_sessions/lifecycle.gosdk/go/user.gosdk/go/utils.gosdk/mcp/src/index.tssdk/ts-compat/README.mdsdk/ts-compat/src/client.tssdk/ts-compat/test/unit/client.test.tssdk/ts/README.mdsdk/ts/examples/app_sessions/lifecycle.tssdk/ts/src/app/packing.tssdk/ts/src/blockchain/evm/app_registry_abi.tssdk/ts/src/blockchain/evm/index.tssdk/ts/src/blockchain/evm/locking_client.tssdk/ts/src/client.tssdk/ts/src/core/types.tssdk/ts/src/rpc/api.tssdk/ts/src/rpc/client.tssdk/ts/src/rpc/methods.tssdk/ts/src/rpc/types.tssdk/ts/src/utils.tssdk/ts/test/unit/abi-drift.test.tssdk/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
a9bbca9 to
9ea5d4d
Compare
| 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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
ihsraham
left a comment
There was a problem hiding this comment.
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.
|
Re the out-of-diff bot notes:
|
…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>
9c211c7 to
1729d99
Compare
nksazonov
left a comment
There was a problem hiding this comment.
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.golines 859–870 and 933–944:NewHandler(...)called with old signature (extra&MockActionGateway{}+trueargs);app.AppInfoV1/app.AppV1used at lines 901–902.rebalance_app_sessions_test.goline 1196:&MockActionGateway{}passed toNewHandler.submit_app_state_test.goline 1956:&MockActionGateway{}passed toNewHandler.submit_deposit_state_test.golines 833–843: struct literal setsactionGateway:andappRegistryEnabled:fields, both removed fromHandler.
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 ( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yep, good catch. Fixed in fe70570 — added DROP TABLE IF EXISTS before each CREATE TABLE in the Down block.
… 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>
|
Merged latest |
… feat/remove-aral # Conflicts: # nitronode/runtime.go # nitronode/store/database/app.go
## 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
Summary
Removes three interlinked, unused subsystems that were wired together through the action gateway. None were reachable by default (both
NITRONODE_APP_REGISTRY_ENABLEDandNITRONODE_ACTION_LIMITS_ENABLEDdefaulted to off), and none are planned.Action allowances (rate limiting)
nitronode/action_gateway/package,action_logstore + modelcore.GatedAction/core.ActionAllowance+ theTransitionType/AppStateUpdateIntent.GatedAction()mappersAllowActioncall sites, and theuser.v1.get_action_allowancesRPC methodApp registry
nitronode/api/apps_v1/, theappstore + model,pkg/appregistry types (AppV1/AppInfoV1/PackAppV1)apps.v1.*RPC methods, and the gatedGetApplookup increate_app_sessionUser staking
user_stakedstore + modelUpdateUserStaked/HandleUserLockedBalanceUpdated,LockingContractEventHandler*,UserLockedBalanceUpdatedEventLockingContractAddressacrosscore→rpc→node.v1.get_config→ both SDKsCross-cutting cleanup
sdk/go,sdk/ts,sdk/ts-compat, andcerebrodocs/api.yamlschemas + methods, drift guards + snapshotsAppRegistryClient,MaxAppMetadataLen,AppIDV1Regex20260603000000_drop_app_registry_staking_action_log.sql(dropsapps_v1,action_log_v1,user_staked_v1;Downrecreates them)Scope: 119 files, +181 / −9507.
Notes
ApplicationIDstays a plain string field (the registry lookup was gated and is now gone).blockchain_confignow requireschannel_hub_address(a locking-only blockchain is no longer valid). Prod/sandboxblockchains.yamlhave no locking entries, so no deploy config breaks.sdk/mcp/content/is gitignored (regenerated on build); not committed.apps.v1.*anduser.v1.get_action_allowancesRPC methods.locking_contract_addressfrom thenode.v1.get_configresponse.Test plan
go build ./.../go vet ./.../go test ./...sdk/tsbuild — 182 tests incl. RPC/ABI/public-API drift guardssdk/ts-compatbuild + 41 testssdk/mcptypecheck + content regenforge build🤖 Generated with Claude Code
Summary by CodeRabbit