Skip to content
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

Implemented a call to reportMalicious with 0 gas price #59

Merged
merged 3 commits into from
Jan 11, 2019

Conversation

vkomenda
Copy link

@vkomenda vkomenda commented Jan 9, 2019

Fixes #50.

The transact function was cherry-picked from #52.

@vkomenda vkomenda requested review from DemiMarie and afck January 9, 2019 16:50
@DemiMarie
Copy link

Does this include the infrastructure to allow some transactions to be done without gas being charged?

Copy link
Collaborator

@afck afck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this include the infrastructure to allow some transactions to be done without gas being charged?

@DemiMarie: No, only the methods to create a gas price 0 transaction, but not to allow it. That will be #57.

Ok(_) => warn!(target: "engine", "Reported malicious validator {}", address),
Err(s) => warn!(target: "engine", "Validator {} could not be reported {}", address, s),
}
}

fn report_benign(&self, address: &Address, _set_block: BlockNumber, block: BlockNumber) {
let data = validator_report::functions::report_benign::encode_input(*address, block);
match self.transact(data) {
match self.transact(data, None) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this also be 0? I think we want to allow validators to fully work with empty accounts.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about benign misbehaviour but now that you asked about it I double-checked the wiki and there isn't a big difference in how the two kinds of misbehaviour are reported. So it makes sense to zero gas price on that one too.

Speaking of empty accounts, is it correct not to zero gas as well? I think it is but I'd like to double-check.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's correct, yes: Service transactions do consume gas, but the gas doesn't cost anything. (But take everything I say with a mountain of salt…)

@@ -207,7 +209,7 @@ mod tests {
assert_eq!(client.chain_info().best_block_number, 2);

// Check if misbehaving validator was removed.
client.transact_contract(Default::default(), Default::default()).unwrap();
client.transact(Action::Call(Default::default()), Default::default(), None, None).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that equivalent to client.transact_contract(Default::default(), Default::default()).unwrap();?
(Also, I don't understand what this line does at all: It calls the contract at address 0 with data 0?)

Copy link
Author

@vkomenda vkomenda Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the default Action is Create. Yes, you are right. I thought you removed transact_contract and replaced it with transact.

The line appears to attempt to create a transaction after the validator has been removed. The last assertion below ensures that that transaction didn't appear in any block.

@vkomenda vkomenda merged commit d55bbb7 into aura-pos Jan 11, 2019
@vkomenda vkomenda deleted the vk-service-contract-report-malicious branch January 11, 2019 16:25
afck pushed a commit that referenced this pull request Jan 14, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Jan 15, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Jan 15, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Jan 16, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Jan 16, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Jan 16, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Jan 23, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
vkomenda pushed a commit that referenced this pull request Feb 6, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
vkomenda pushed a commit that referenced this pull request Feb 6, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
vkomenda pushed a commit that referenced this pull request Feb 19, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
vkomenda pushed a commit that referenced this pull request Feb 19, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Feb 28, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
DemiMarie pushed a commit that referenced this pull request Mar 3, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
afck added a commit that referenced this pull request Apr 10, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
afck added a commit that referenced this pull request Jul 24, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
afck added a commit that referenced this pull request Oct 7, 2019
* Make calls service transactions i.e. zero gas price.

* call reportMalicious with 0 gas price

* call reportBenign with 0 gas price as well
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.

3 participants