Conversation
Contributor
|
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 configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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 |
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.
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.