Remove inbound removal endpoint; converge membership on boot#129
Merged
Conversation
The council→provider push (POST /api/v1/council/removed) inverted the pull model and added an unauthenticated inbound surface. Remove it and move removal-honouring fully onto the pull path. Removed: - src/core/service/council-notify/ (handle-removal.ts + its test) - tests/integration/http/council-removed.test.ts - the POST /council/removed route; buildCouncilRouter is empty again. Pull-path verification (with the endpoint gone): - Watcher already demotes to REJECTED on provider_removed (deactivateMembership) — unchanged. - Bundle submission already refuses a removed membership: resolveChannel context throws "no active membership" via getActiveForPp — unchanged. - Boot converge-by-query for MEMBERSHIP was MISSING (only channel-status converged on boot; a removal during downtime relied on retention-bound event replay). Added convergeMembershipStatusesOnBoot: on boot, query each council's authoritative membership-status and demote on 404 via the same deactivateMembership path. Env-free + unit-tested.
d315cbe to
2f83be5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the inbound
POST /api/v1/council/removednotice endpoint added in #127 (it inverted the pull model and added an unauthenticated inbound surface), and moves removal-honouring fully onto the pull path.How
Removed:
src/core/service/council-notify/(handle-removal.ts + its test)tests/integration/http/council-removed.test.tsPOST /council/removedroute;buildCouncilRouteris an empty router again.Pull-path verification (with the endpoint gone):
provider_removed→ REJECTED viadeactivateMembership— already true, unchanged.resolveChannelContextthrows "no active membership" viagetActiveForPp(channel-resolver.ts:108), unchanged.convergeMembershipStatusesOnBoot: on boot, query each council's authoritative/public/provider/membership-statusand demote on 404 via the samedeactivateMembershippath. Env-free + unit-tested. This is the sibling of the existing channel-status boot convergence — pull direction (provider→council), no inbound surface.Tests
Full suite locally on pinned deno 2.8.2:
fmt --check,lint,check src/main.ts, CI pay-test job (116),test:unit(132, incl. 4 new boot-converge tests),test:integration(99) — all green.local-dev lifecycle e2e (deploy → pay → on-chain
remove_provider) against this branch: passed (exit 0). On provider (re)boot the membership is demoted ACTIVE→REJECTED via the boot converge-by-query (proven by the live DB transition; the on-chain watcher start even failed on the restart, so the converge backstop alone demoted it — exactly its purpose), with no notify endpoint in the path; post-demotion there are 0 active memberships so the bundle gate refuses new submissions.Version: 0.9.4 → 0.9.5 (standalone bump commit).
Coordination
Lands with council-platform (removes the outbound push) and provider-stack (removes the matching inbound endpoint).