-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request for AuRa: call reportMalicious
with zero gas price
#50
Comments
I think we should use
The |
@vkomenda |
I see. That's convenient for getting the account private key. I improved typing a bit:
We can return the Error cleanly. Also there is no need to make the function closure argument mutable.
|
@vkomenda Thank you. |
reportMalicious
with zero gas price
I've updated the description ☝️ |
Fixed by #59. |
Every validator in AuRa calls
reportMalicious
function when he sees misbehavior of another validator: https://wiki.parity.io/Validator-Set.html#reporting-contractWe need to make its calling with zero gas price to let the validators report with zero wallet's balance.
The strikethrough text below is no longer relevant.
ThereportMaliciousValidator
function must be called by SYSTEM_ADDRESS in AuRa instead of standardreportMalicious
function (described in https://wiki.parity.io/Validator-Set.html).The standardreportMalicious
function looks like this:function reportMalicious(address _validator, uint256 _blockNumber, bytes _proof) public
So, what we should do with it:- callreportMaliciousValidator
instead ofreportMalicious
and do that calling from SYSTEM_ADDRESS (instead of validator's address).- pass the_message
and_signature
parameters instead of_validator
,_blockNumber
,_proof
:function reportMaliciousValidator(bytes _message, bytes _signature) public onlySystem {...}
The_message
parameter is a bytes sequence which contains the address of malicious validator (see_validator
param for the standardreportMalicious
function) and block number (see_blockNumber
param for the standardreportMalicious
function) on which the validator misbehaved. Inside the contract this parameter is parsed as follows: https://github.com/poanetwork/pos-contracts/blob/1240a2e6ab098f18c868324fb2c22454417807d5/contracts/ValidatorSetAuRa.sol#L53-L56So, the_message
param has a length of52
bytes:20
bytes for malicious validator address and32
bytes for block number.The_message
should be signed by validator's private key, and the resulting signature should be passed through the_signature
param.The signature is needed to prevent the possibility of passing arbitrary validator's address and is used to recover validator's address using Solidity'secrecover
function: https://github.com/poanetwork/pos-contracts/blob/1240a2e6ab098f18c868324fb2c22454417807d5/contracts/ValidatorSetAuRa.sol#L138I don't know how the signing code could be implemented in Rust, but this should work as web3'ssign
function works:web3.eth.accounts.sign
. Some examples are available here: https://ethereum.stackexchange.com/questions/1777/workflow-on-signing-a-string-with-private-key-followed-by-signature-verificatioThe text was updated successfully, but these errors were encountered: