Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@MuncleUscles gentle ping on this one when you get a chance. |
|
Thanks! Reviewed: the redaction covers exactly the paths #1731 left open ( |
The committee entries come from Validator.to_dict(), which includes private_key, and _serialize_tx returned them unsanitized.
|
Correction to my earlier note: there was one more leak path. Pushed e414e69 on top of this branch (fast-forward, no force push):
Unit suite: 1677 passed, 7 skipped. Smaller non-blocking notes from review: |
danieljrc888
left a comment
There was a problem hiding this comment.
Reviewed for the v0.123 release candidate; unit suite and CI green.
|
/run-e2e all Frozen landing cut: #1765 alone, head |
Lands four reviewed fork PRs together after a full E2E run on this exact head: - #1765: redact validator private keys from call receipts and explorer payloads - #1715: bind postgres, redis and ollama host ports to loopback - #1773: normalize addresses in raw-SQL balance operations - #1789: normalize the address in sim_fundAccount Co-authored-by: Kanan <93033289+kriss39@users.noreply.github.com> Co-authored-by: Starling <82058629+Starling-spell@users.noreply.github.com> Co-authored-by: Alicepoltora <Alicepoltora@users.noreply.github.com>
What
Receipt.node_configalways carries the executing validator'sprivate_key(Node._create_enhanced_node_config). #1731 added_sanitize_rpc_private_keysto the transaction/block getters, but three other paths still hand the raw receipt to the client:sim_call(and thereforesim_estimateTransactionFees) returnsreceipt.to_dict()unredacted;gen_call,eth_callandsim_callraiseexecution failedwithdata.receipt = receipt.to_dict()unredacted whenever contract execution fails;/explorer/transactions*,/explorer/address/{addr}) serializesconsensus_data/consensus_historyverbatim, includingleader_receipt[*].node_config.private_keyandvalidators[*].node_config.private_key.This PR:
backend/protocol_rpc/redaction.py(so the explorer can use them without importingendpoints), keeping theendpoints._sanitize_rpc_private_keysname for the existing call sites;sim_callresult, the threeexecution failederror payloads and_serialize_tx;tests/unit/protocol_rpc/test_receipt_private_key_redaction.py:sim_callresult,gen_call/eth_callerror data, and explorer_serialize_tx(redacted by default, shown withSHOW_VALIDATOR_PRIVATE_KEYS_IN_RPC=true, matching the fix: redact validator private keys from RPC #1731 tests).Why
On a hosted Studio anyone can issue an anonymous
sim_callagainst a registered validator, make anygen_callfail, orGET /explorer/transactions?limit=100, and read the validators' signing keys.SHOW_VALIDATOR_PRIVATE_KEYS_IN_RPCkeeps working as the local-debug escape hatch.Testing done
PYTHONPATH=. pytest tests/unit --ignore=tests/unit/test_rpc_endpoint_manager.py→ 1569 passed, 7 skipped.v0.123-devwithout the backend change (thesim_callresult and the error payloads contain the key; explorernode_configkeepsprivate_key) and pass with it.black/ruffclean on the touched files.Decisions made
sim_estimateTransactionFeesfor fee accounting) is unchanged.Checks
Reviewing tips
The diff in
endpoints.pyis mostly the moved helper definitions; the behavioural change is the three_sanitize_rpc_private_keys(receipt.to_dict())wraps plus the two lines inexplorer/queries.py.