feat(web): add persistent nonce expiry and replay protection for sign… - #382
Merged
enliven17 merged 2 commits intoJul 27, 2026
Merged
Conversation
…ed requests Closes enliven17#168 Replace in-memory Map nonce guard with DB-backed tls_consumed_nonces table. Consumed nonces are persisted with a UNIQUE constraint on (talosId, nonce) so single-use semantics hold across process restarts and concurrent requests. Adds race-condition test with simulated unique-violation concurrency.
|
@Abolax123 is attempting to deploy a commit to the Cankat's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Abolax123 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Add proposal-based admin timelocks for
TalosRegistryandTalosNameServiceSoroban contracts.This enforces a configurable minimum delay between scheduling and executing high-impact administrative actions (protocol fee changes, admin transfers, registry pointer updates), giving on-chain observers a guaranteed visibility window before any change takes effect.
Changes
TalosRegistry
AdminActionenum (SetProtocolFee,ProposeAdmin),ProposalStatusenum (Scheduled,Executed,Cancelled),TimelockProposalstruct,TimelockConfigstructschedule_action,execute_action,cancel_action,set_timelock_config,get_timelock_config,get_timelock_proposalset_protocol_feeandpropose_adminpanic with"Timelock enabled: action must be scheduled"whenmin_delay > 0tl_sch,tl_exec,tl_cnl,tl_cfgCONTRACT_VERSION(1, 0, 0)→(1, 1, 0)min_delay = 0— no behaviour change for existing callersTalosNameService
AdminAction,ProposalStatus,TimelockProposal,TimelockConfigpattern as Registryschedule_action,execute_action,cancel_action,set_timelock_config,get_timelock_config,get_timelock_proposalAdminActionvariants:SetRegistryContract,SetAdminset_registry_contractandset_adminblocked whenmin_delay > 0tl_sch,tl_exec,tl_cnl,tl_cfg,reg_updCONTRACT_VERSION(1, 0, 0)→(1, 1, 0)min_delay = 0Documentation
contracts/README.mdupdated with full timelock architecture, entry-points table, auth matrix, event schema, operational runbook (schedule / execute / cancel / rollback CLI examples), known limitations, and version bump notesRelated Issues
Closes #168
Test Plan
timelock_config_defaults_and_updates— verifies defaults and non-admin guardtimelock_schedule_execute_happy_path— full schedule → advance ledger → execute flowtimelock_schedule_propose_admin_happy_path— ProposeAdmin action via timelocktimelock_early_execution_fails— panics before ETAtimelock_expired_execution_fails— panics after grace windowtimelock_cancellation_clears_proposal— cancel marks Cancelled and blocks re-executiontimelock_direct_admin_calls_rejected_when_min_delay_active— direct bypass rejectedname_service_timelock_schedule_execute_registry_update— Name Service full flowname_service_timelock_direct_call_guarded— Name Service direct bypass rejectedname_service_timelock_cancellation— Name Service cancel flowcargo test(fromcontracts/)cargo build --target wasm32-unknown-unknown --releaseversion()returns(1, 1, 0)in both contractsget_timelock_config()returns{ min_delay: 0, grace_period: 604800 }by defaultmin_delay = 0(backward-compatible)min_delay > 0Visual Changes
No UI changes.
Checklist
min_delay = 0).