Skip to content

PIP-50: align the spec with the reference implementation - #316

Closed
carbonflake wants to merge 3 commits into
pactus-project:mainfrom
carbonflake:main
Closed

carbonflake wants to merge 3 commits into
pactus-project:mainfrom
carbonflake:main

Conversation

@carbonflake

Copy link
Copy Markdown
Contributor

Summary

This revises my Draft of PIP-50 after writing a full implementation in the node.
Building and testing it showed where the spec was ambiguous or unsafe.
The intent is unchanged: one live, deposit-backed commitment slot per account.

Status stays Draft. The node pull request will stay a draft until this PIP is Accepted.

What changed vs the merged revision

Topic Before After
UpdatedAt* Refreshed by every Set Moves only when RootHash, ManifestURI or AnchorType changes; a deposit top-up keeps the attestation date
Anchor pool "Sized like Transfer" 10% of MaxSize, like BatchTransfer; anchors placed last in a block
JSON bytes hex in JSON-RPC base64 (like every protobuf bytes field); int64/uint32 encoding and BigInt note for locked_deposit
ZMQ anchor_info Height little-endian Big-endian like every other topic; exact frame layout, sizes and sequence gap rule
GetAnchor Unspecified for validator/treasury found = false; only a malformed address is an error
ListAnchors Scan of all accounts Local in-memory index, rebuilt at startup (still non-consensus)
Activation 75% implied as a rule Clarified as the PIP-51 proposer rule, not a validation rule, and why
PAC-ANCHOR-1 simplemerkle (duplicates last node, no leaf/node separation) RFC 9162 tree with BLAKE2b-256, name-bound leaves, size-bound root, proof algorithm, JSON proof document, test vectors
Test 21 / 22 Refresh on every Set; trailing bytes Match the new date rule; forgery fails on signature

The PAC-ANCHOR-1 change matters most for apps: with the Bitcoin-style tree,
[a,b,c] and [a,b,c,c] share a root and an inner node can be proven as a 64-byte file.

Implementation status

The reference implementation covers the whole spec: payload, execution, pool,
activation at protocol version 5, gRPC / JSON-RPC / HTTP / ZMQ, wallet, and a
util/anchorprofile package for PAC-ANCHOR-1. Tests include lifecycle, two-node
consensus, restarts, fuzzing and an end-to-end run on four nodes; go test -race
and the deadlock job pass.

PR Checklist

  • I have read and followed the proposal guidelines in PIP-1.
  • This replaces PIPs/pip-50.md in place (same number, same author).

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