Skip to content

fix(vm): relocate pqc precompile addresses to avoid conflicts#44

Open
Federico2014 wants to merge 2 commits into
release_post_quantumfrom
fix/review_issues
Open

fix(vm): relocate pqc precompile addresses to avoid conflicts#44
Federico2014 wants to merge 2 commits into
release_post_quantumfrom
fix/review_issues

Conversation

@Federico2014

@Federico2014 Federico2014 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Relocates the five PQC precompile addresses from the 0x16–0x1a range to the 0x02000016–0x0200001a namespace to avoid collisions with future Ethereum-compatible precompiles occupying the lower address space. Updates all related comments and test files accordingly.

Also fixes a minor energy estimation bug in ValidateMultiPQSig.getEnergyForData: the malformed-input fallback was returning MAX_SIZE × WORST_PQ_ENERGY (5 × 470 = 2350), which underestimates the true worst case when all slots are ECDSA (5 × 1500 = 7500). The fallback now uses MAX_SIZE × WORST_ENERGY_PER_SIGN.

Why are these changes required?

The Ethereum precompile address space (0x010xff) is continuously being allocated by new EIPs. Placing TRON PQC precompiles at 0x16–0x1a risks future conflicts. The 0x02000000 namespace provides a TRON-specific range that will not clash with Ethereum assignments.

This PR has been tested by:

  • Unit Tests

Follow up

Extra details

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: 5920d884-93d6-494e-8c7e-2b70eecb75dc

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 fix/review_issues

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.

@Federico2014 Federico2014 changed the title fix(vm): relocate pqc precompiles address to avoid conficts fix(vm): relocate pqc precompile addresses to avoid conflicts Jun 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread actuator/src/main/java/org/tron/core/vm/PrecompiledContracts.java Outdated
@Federico2014 Federico2014 force-pushed the fix/review_issues branch 2 times, most recently from d946957 to ea62e81 Compare June 23, 2026 10:02
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.

1 participant