Skip to content

fix(dpp): block pre-programmed distribution changes on token update#3461

Draft
PastaPastaPasta wants to merge 1 commit intov3.1-devfrom
codex/fix-pre-programmed-distribution-validation-issue
Draft

fix(dpp): block pre-programmed distribution changes on token update#3461
PastaPastaPasta wants to merge 1 commit intov3.1-devfrom
codex/fix-pre-programmed-distribution-validation-issue

Conversation

@PastaPastaPasta
Copy link
Copy Markdown
Member

@PastaPastaPasta PastaPastaPasta commented Apr 8, 2026

Motivation

  • pre_programmed_distribution was added to TokenDistributionRulesV0 but was not checked during token configuration updates, allowing updates to modify emission schedules without any change-control enforcement.

Note: this was identified as a security issue by codex. In my investigation, I found that this is NOT a security issue. None of the exposed update methods are able to update pre_programmed_distribution however; in my view, it is best to explicitly check in validation that these do not change.

Description

  • Added a guard in validate_token_config_update_v0 that rejects any update which changes pre_programmed_distribution by returning a DataContractTokenConfigurationUpdateError for preProgrammedDistribution.

Testing

  • Ran cargo test -p rs-dpp --lib --no-run, which failed because the package is named dpp (package name mismatch), not due to the code change.
  • Ran cargo test -p dpp --lib --no-run, which compiled the package and built the test binary successfully (test profile finished).

Codex Task

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0088a27e-81c3-4c4e-b61f-0e7cf5ebf195

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-pre-programmed-distribution-validation-issue

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added this to the v3.1.0 milestone Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant