Skip to content

fix: resolve issues #237-240 — event topics, error codes, and upgrade mechanism - #315

Open
obanai9 wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
obanai9:main
Open

fix: resolve issues #237-240 — event topics, error codes, and upgrade mechanism#315
obanai9 wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
obanai9:main

Conversation

@obanai9

@obanai9 obanai9 commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Resolves #237, #238, #239, and #240 in a single comprehensive pull request.

Issues Resolved

#237 [High] Split the shared paused event topic into paused/unpaused

  • pause() now emits paused topic
  • unpause() now emits unpaused topic (was previously paused with false payload)
  • Allows indexers to filter by topic name alone without decoding payloads
  • Breaking change: indexers filtering on the old shared paused topic must now subscribe to both paused and unpaused separately

#238 [High] Fix missing event emission in set_src_chain_allowlist_enabled

  • set_src_chain_allowlist_enabled now emits src_chain_allowlist_enabled event
  • Matches behavior of set_dst_allowlist_enabled
  • Allows ops dashboards to observe enforcement toggles without polling

#239 [High] Add dedicated Error variants instead of reusing Error::ZeroAmount

  • New Error::BatchSizeExceeded for batch validation (codes 29)
    • batch_submit_intent and batch_accept_intent now use this error
  • New Error::ExtensionAlreadyGranted for extension guard (code 30)
    • request_extension now uses this instead of ZeroAmount
  • Solver bots can now distinguish validation failures from resource-limit errors

#240 [High] Add a contract-upgrade mechanism to proof_registry

  • Added upgrade(new_wasm_hash) admin-only entrypoint
  • Added migrate() internal function with idempotent guard
  • Reuses env.deployer().update_current_contract_wasm() pattern
  • Prevents accidental double-migration via MigrationDone flag

Changes

intent_settlement/src/lib.rs

  • Added missing constants: MAX_BATCH_SIZE, MAX_EXTENSION_DURATION, DEFAULT_* variants
  • Added missing DataKey variants: Config, PendingAdmin, PendingDstTokenAdd/Remove, MinBondMultiplier, AllowedDstTokenList, ExtensionGranted
  • Fixed Error enum: resolved duplicate discriminant values, added new variants with proper numbering (29-36)
  • Updated pause() to emit empty payload with paused topic
  • Updated unpause() to emit empty payload with new unpaused topic
  • Added event emission to set_src_chain_allowlist_enabled()
  • Fixed batch_submit_intent to use BatchSizeExceeded error
  • Fixed batch_accept_intent to use BatchSizeExceeded error
  • Fixed request_extension to use ExtensionAlreadyGranted error

proof_registry/src/lib.rs

  • Added MigrationDone variant to ProofKey enum
  • Added upgrade() admin-only entrypoint
  • Added migrate() internal idempotent migration guard

Documentation

  • Updated CHANGELOG.md with breaking change notification and feature documentation
  • Updated docs/event-schema.md: split paused documentation, added unpaused, documented dst_allowlist_enabled and src_chain_allowlist_enabled
  • Updated README.md: comprehensive Error Reference table with all error codes (1-36)

Indexer

  • Updated indexer/reference-indexer.js to handle separate paused and unpaused topics
  • Added dst_allowlist_enabled and src_chain_allowlist_enabled to configuration change cases

Test Plan

  • Run make test to verify all existing tests still pass
  • Verify pause/unpause events are emitted as separate topics
  • Verify batch operations reject oversized batches with BatchSizeExceeded
  • Verify extension requests reject already-extended intents with ExtensionAlreadyGranted
  • Verify src_chain_allowlist_enabled event is emitted
  • Manual testing: call upgrade() on proof_registry, verify migrate guard blocks double-execution

Closes

Closes #237
Closes #238
Closes #239
Closes #240

…rror codes, and upgrade mechanism

Resolves stellar-vortex-protocol#237: Split the shared paused/unpaused event topic
- pause() emits 'paused' topic
- unpause() emits 'unpaused' topic (was 'paused' with false payload)
- Allows indexers to filter by topic name alone without decoding payloads
- Breaking change: indexers must subscribe to both topics separately
- Updated CHANGELOG, event-schema.md, and reference-indexer.js

Resolves stellar-vortex-protocol#238: Add missing event emission to set_src_chain_allowlist_enabled
- set_src_chain_allowlist_enabled now emits 'src_chain_allowlist_enabled' event
- Matches behavior of set_dst_allowlist_enabled
- Allows ops dashboards to observe both allowlist toggles without polling
- Updated event-schema.md and reference-indexer.js
- Added dst_allowlist_enabled to event schema documentation

Resolves stellar-vortex-protocol#239: Add dedicated Error variants instead of reusing ZeroAmount
- New Error::BatchSizeExceeded (code 29) for batch size validation
  - batch_submit_intent and batch_accept_intent now use this error
  - Added MAX_BATCH_SIZE constant
- New Error::ExtensionAlreadyGranted (code 30) for extension guard
  - request_extension now uses this error instead of ZeroAmount
  - Added MAX_EXTENSION_DURATION constant
- Allows solver bots to distinguish between validation and resource-limit errors
- Updated README error reference table with all new error codes

Resolves stellar-vortex-protocol#240: Add contract-upgrade mechanism to proof_registry
- Added upgrade(new_wasm_hash) admin-only entrypoint
- Added migrate() internal function with idempotent guard
- Reuses env.deployer().update_current_contract_wasm() pattern
- Prevents accidental double-migration via MigrationDone flag
- Allows proof_registry to evolve without data loss or re-initialization
- Updated CHANGELOG with upgrade mechanism documentation

Additional changes:
- Fixed Error enum: resolved duplicate discriminant values (was 22, 23 repeated)
- Added all missing DataKey variants: Config, PendingAdmin, PendingDstTokenAdd,
  PendingDstTokenRemove, MinBondMultiplier, AllowedDstTokenList, ExtensionGranted
- Added missing default constants: DEFAULT_MIN_BOND, DEFAULT_FILL_WINDOW, etc.
- Added missing Error variants: InvalidConfig, TimelockNotElapsed,
  NoPendingAdminTransfer, NoPendingDstTokenChange, CancelCooldownNotExpired,
  AmountTooLarge (renumbered to avoid conflicts)
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@obanai9 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant