Add CIP-172: Canonical Transaction RLP Encoding#172
Open
peilun-conflux wants to merge 4 commits into
Open
Conversation
Conflux computes a transaction hash over the exact received bytes while its RLP decoder accepts non-minimal encodings, so one transaction can carry multiple hashes, breaking the unique-hash assumption behind transactions_root, receipts, inclusion proofs, deduplication, and RPC; most visibly, blocks that pack a malleated transaction are rejected by other nodes over the root mismatch. The fix (conflux-rust #3561) rejects non-canonically encoded transactions, which tightens block validity and is therefore a spec-breaking consensus change that requires a CIP before it can merge; this drafts that CIP as a height-gated consensus rule plus an immediate node-local mempool policy. CIP number is left "<to be assigned>" for an editor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per the README, the PR ID serves as the CIP ID at the submitter's discretion; this PR is Conflux-Chain#172, so the file is renamed to cip-172.md and the header updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CIP-1 forbids the Discussions header from pointing to a GitHub pull request, and the header is optional for CIPs discussed within the dev team; the reference-implementation PR remains linked in the Implementation section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CIP bodies should not reference code-level identifiers; the config key name lives in the reference PR, and the spec-level parameter name suffices. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
This CIP specifies the consensus change implemented in conflux-rust #3561 (branch
fix/typed-tx-canonical-hash).Conflux computes a transaction's hash over the exact bytes the transaction was decoded from, while the RLP decoder also accepts non-minimal encodings, so the same transaction can appear under more than one hash. This breaks the unique-hash assumption behind
transactions_root, receipts, inclusion proofs, transaction pool deduplication, and RPC — most visibly, blocks that pack a malleated transaction are rejected by other nodes over thetransactions_rootmismatch.From an activation height, this CIP makes a block invalid if any transaction in its body is not canonically encoded. It also recommends that upgraded clients reject non-canonically encoded transactions at transaction pool insertion immediately, ahead of activation.
The CIP number 172 follows the PR ID, per the README's provisional-ID convention.
🤖 Generated with Claude Code
This change is