Skip to content

fix: add CI verification for AMM constant sync with smart contract#101

Merged
Jaydbrown merged 2 commits into
Nodus-protocol:mainfrom
Yerimahjr:feat/shared-amm-constants
Jun 20, 2026
Merged

fix: add CI verification for AMM constant sync with smart contract#101
Jaydbrown merged 2 commits into
Nodus-protocol:mainfrom
Yerimahjr:feat/shared-amm-constants

Conversation

@Yerimahjr

Copy link
Copy Markdown
Contributor
  • Add CI step that fetches the live Smart Contract src/math.rs and compares FEE_NUMERATOR, FEE_DENOMINATOR, and MINIMUM_LIQUIDITY against src/pool/math.rs, failing the build on drift
  • Add a local pinned unit test (fee_constants_match_known_smart_contract_values) as defense-in-depth for offline/local development
  • Expand the doc comment to make the sync requirement and CI enforcement explicit
  • Link to issue [CE-021] FEE_NUMERATOR and FEE_DENOMINATOR duplicated from nodus-contract — single source of truth violation #61 for the longer-term shared-crate fix (nodus-amm-types), tracked as a follow-up since it requires coordinating a new repo and Cargo.toml changes in both Smart Contract and Core Engine

This implements Option 2 from the issue as an immediate, low-risk fix. Option 1 (shared nodus-amm-types crate) remains the proper long-term solution and is out of scope for this PR due to its cross-repo nature.

Closes #61

Summary

Brief description of what this PR does.

Closes #

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Tests
  • Chore / tooling

How Was It Tested?

Describe the tests you ran and how to reproduce them.

Checklist

  • My code follows the style guidelines in CONTRIBUTING.md
  • I have rebased onto the latest main (no merge commits)
  • I have added tests for my changes
  • All existing tests pass locally
  • I have linked the issue above (Closes #N)
  • I have updated documentation if needed

Screenshots (if UI change)

- Add CI step that fetches the live Smart Contract src/math.rs and
  compares FEE_NUMERATOR, FEE_DENOMINATOR, and MINIMUM_LIQUIDITY against
  src/pool/math.rs, failing the build on drift
- Add a local pinned unit test (fee_constants_match_known_smart_contract_values)
  as defense-in-depth for offline/local development
- Expand the doc comment to make the sync requirement and CI enforcement explicit
- Link to issue Nodus-protocol#61 for the longer-term shared-crate fix (nodus-amm-types),
  tracked as a follow-up since it requires coordinating a new repo and
  Cargo.toml changes in both Smart Contract and Core Engine

This implements Option 2 from the issue as an immediate, low-risk fix.
Option 1 (shared nodus-amm-types crate) remains the proper long-term
solution and is out of scope for this PR due to its cross-repo nature.

Closes Nodus-protocol#61
@Yerimahjr Yerimahjr requested a review from Jaydbrown as a code owner June 20, 2026 09:43
@Jaydbrown Jaydbrown merged commit b60e2ca into Nodus-protocol:main Jun 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CE-021] FEE_NUMERATOR and FEE_DENOMINATOR duplicated from nodus-contract — single source of truth violation

3 participants