You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CRITICAL] No upgrade coordination between contracts — independent upgrades break cross-contract ABI #170
The four contracts (prediction_market, pulse_token, referral_registry, leaderboard) can each be upgraded independently via their upgrade() entry points. There is no cross-contract version check: a governor can upgrade one contract without upgrading the others, breaking the cross-contract ABI.
Impact
If the leaderboard adds a new storage key that prediction_market expects, but the market contract wasn't upgraded, the cross-contract call reverts or reads garbage.
If pulse_token changes its mint signature, the leaderboard's reward call breaks.
If referral_registry changes its register_referral return type, place_bet fails mid-flow.
ABI mismatches are silent on deployment — they only surface at runtime when a user triggers the affected call path.
Fix
Add an interface_version() or contract_version() entry point to every contract.
Have the governor set a coordinated "version bundle" via set_config that pins all four versions together.
Reject calls from contracts whose version does not match the expected set.
Add a migration path: store an interface compatibility matrix in instance storage.
Gm gm boss. I would like to take this one on. I can add a contract_version() entry point to each of the four contracts, wire the governor's set_config to pin a coordinated version bundle, reject cross-contract calls when the version pinning doesn't match, and build the interface compatibility matrix stored in instance storage as the migration path across upgrades. Please assign it to me.
I'd like to work on resolving this issue. Here is my proposed plan of approach to establish version coordination and prevent ABI mismatches across independent contract upgrades:
Plan of Approach
Implement Contract Version Entry Points:
Add a contract_version() -> u32 entry point to all four ecosystem contracts (prediction_market, pulse_token, referral_registry, and leaderboard).
Governor Version Bundle Management:
Extend the governor configuration (set_config) to store a coordinated "version bundle" defining expected interface versions for each target contract.
Add validation logic during cross-contract interactions to verify that target contract versions match the pinned versions in the active version bundle.
Cross-Contract Version Checks & Rejection:
Implement version assertions at the start of cross-contract call entry paths.
Reject execution with a descriptive error (e.g., Error::VersionMismatch) if an uncoordinated upgrade leads to an invalid contract version pair.
Compatibility Matrix & Migration Path:
Store an interface compatibility matrix in instance storage to allow non-breaking, backward-compatible interface updates across version transitions.
Testing & Validation:
Write unit and integration tests simulating independent contract upgrades.
Verify that matched version upgrades succeed smoothly while mismatched cross-contract calls fail explicitly at runtime before state modification.
I can implement these version check mechanisms and tests promptly.
Activity
darkifyyy commentedon Aug 23, 2026
Hello,
I can work on this
Could you please assign it to me
Thank you
Samaro1 commentedon Aug 23, 2026
Gm gm boss. I would like to take this one on. I can add a contract_version() entry point to each of the four contracts, wire the governor's set_config to pin a coordinated version bundle, reject cross-contract calls when the version pinning doesn't match, and build the interface compatibility matrix stored in instance storage as the migration path across upgrades. Please assign it to me.
samjay8 commentedon Aug 23, 2026
Hi team,
I'd like to work on resolving this issue. Here is my proposed plan of approach to establish version coordination and prevent ABI mismatches across independent contract upgrades:
Plan of Approach
Implement Contract Version Entry Points:
contract_version() -> u32entry point to all four ecosystem contracts (prediction_market,pulse_token,referral_registry, andleaderboard).Governor Version Bundle Management:
set_config) to store a coordinated "version bundle" defining expected interface versions for each target contract.Cross-Contract Version Checks & Rejection:
Error::VersionMismatch) if an uncoordinated upgrade leads to an invalid contract version pair.Compatibility Matrix & Migration Path:
Testing & Validation:
I can implement these version check mechanisms and tests promptly.
grantfox-oss commentedon Aug 23, 2026
🦊 GrantFox — @samjay8 has been assigned to this issue as part of the Third Campaign campaign!
Next steps:
Closes #170)Good luck! Track your progress on GrantFox.
fix: make expected ABI versions runtime-configurable (issue SPulse-Or…
grantfox-oss commentedon Aug 30, 2026
🎉 This issue has been marked as completed on GrantFox!
@samjay8's PR #192 was approved and merged by @Muyideen-js.
🏆 @samjay8: You earned 40 FoxPoints for this contribution! Your current tier: Builder (2,180 total points). Track your full progress on GrantFox.
👏 Great work, @samjay8! Keep contributing to SPulse-Org.
Merge branch 'main' into fix/issue-24-leaderboard-merge-corruption
fix: resolve CI failures surfaced by the merge (cargo check + clippy)
fix: collapse set_config args into a Config struct to pass clippy (is…
ci: point invariants job at the cross_contract_invariants crate
feat: guard market creation with 1h min duration and 50-market open c…
chore: repair main so the workspace compiles and tests pass
Merge upstream/main: resolve conflicts from set_config Config-struct …