fix: resolve issues #237-240 — event topics, error codes, and upgrade mechanism - #315
Open
obanai9 wants to merge 1 commit into
Open
fix: resolve issues #237-240 — event topics, error codes, and upgrade mechanism#315obanai9 wants to merge 1 commit into
obanai9 wants to merge 1 commit into
Conversation
…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)
|
@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! 🚀 |
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
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 emitspausedtopicunpause()now emitsunpausedtopic (was previouslypausedwith false payload)pausedtopic must now subscribe to bothpausedandunpausedseparately#238 [High] Fix missing event emission in set_src_chain_allowlist_enabled
set_src_chain_allowlist_enablednow emitssrc_chain_allowlist_enabledeventset_dst_allowlist_enabled#239 [High] Add dedicated Error variants instead of reusing Error::ZeroAmount
Error::BatchSizeExceededfor batch validation (codes 29)batch_submit_intentandbatch_accept_intentnow use this errorError::ExtensionAlreadyGrantedfor extension guard (code 30)request_extensionnow uses this instead ofZeroAmount#240 [High] Add a contract-upgrade mechanism to proof_registry
upgrade(new_wasm_hash)admin-only entrypointmigrate()internal function with idempotent guardenv.deployer().update_current_contract_wasm()patternMigrationDoneflagChanges
intent_settlement/src/lib.rs
MAX_BATCH_SIZE,MAX_EXTENSION_DURATION,DEFAULT_*variantsConfig,PendingAdmin,PendingDstTokenAdd/Remove,MinBondMultiplier,AllowedDstTokenList,ExtensionGrantedpause()to emit empty payload withpausedtopicunpause()to emit empty payload with newunpausedtopicset_src_chain_allowlist_enabled()batch_submit_intentto useBatchSizeExceedederrorbatch_accept_intentto useBatchSizeExceedederrorrequest_extensionto useExtensionAlreadyGrantederrorproof_registry/src/lib.rs
MigrationDonevariant to ProofKey enumupgrade()admin-only entrypointmigrate()internal idempotent migration guardDocumentation
pauseddocumentation, addedunpaused, documenteddst_allowlist_enabledandsrc_chain_allowlist_enabledIndexer
pausedandunpausedtopicsdst_allowlist_enabledandsrc_chain_allowlist_enabledto configuration change casesTest Plan
make testto verify all existing tests still passBatchSizeExceededExtensionAlreadyGrantedCloses
Closes #237
Closes #238
Closes #239
Closes #240