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

Authorities on custom_operation are not checked correctly #210

Closed
vikramrajkumar opened this issue Jan 18, 2017 · 7 comments
Closed

Authorities on custom_operation are not checked correctly #210

vikramrajkumar opened this issue Jan 18, 2017 · 7 comments

Comments

@vikramrajkumar
Copy link
Contributor

From @nathanhourt on May 9, 2016 22:6

The required_auths field on custom_operation should require extra signatures for the accounts listed, but it does not:
https://bitshares.openledger.info/#/block/5975061

Copied from original issue: cryptonomex/graphene#649

@abitmore
Copy link
Member

abitmore commented May 9, 2017

why required_auths is flat_set<account_id_type> but not flat_set<authority>? I think the latter makes more sense (edit: so we can also specify keys).

@oxarbitrage oxarbitrage modified the milestones: Roadmap to hardfork, Hardfork - Operations related, Roadmap to hardfork 1 Aug 13, 2017
@abitmore
Copy link
Member

There is a fix: FollowMyVote/graphene@0bb157e

@abitmore abitmore added the bug label Nov 28, 2017
@abitmore abitmore modified the milestones: Hardfork - Operations and Authority related., Future Consensus-Changing Release Nov 28, 2017
@nathanielhourt
Copy link
Contributor

Gack! This is difficult to write hardfork guards for... You don't have access to chain time in op::get_required_active_authorities()...

I'll see if I can pass that in as another parameter.

@pmconrad
Copy link
Contributor

pmconrad commented Mar 1, 2019

I've solved a similar problem in MUSE aka SOUNDAC by introducing a version parameter in transaction::verify_authority and modifying validation logic depending on that. The correct version to apply is determined externally (i. e. in database and in API).
https://github.com/soundac/SounDAC-Source/blob/0.3.2/libraries/chain/protocol/transaction.cpp#L410

nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
Hardfork guards are complex for this issue, because we can't access
chain time in the operation's get_required_active_authorities() method.

There was no apparent 'good' way to solve this, so I settled for a
fairly nasty hack which seemed the least bad of bad options. Add a
boolean parameter to the verify_authority() functions determining
whether the custom_operation::required_auths field should be ignored or
not, and call these functions setting the boolean appropriately for
whether we have passed the hardfork or not. This works because chain
time is available at the verify_authority() call sites.
@nathanielhourt
Copy link
Contributor

nathanielhourt commented Mar 1, 2019

@pmconrad I didn't see your comment until now, but it seems that we both settled on the same solution. :) I'll take that to mean it's a reasonable solution.

I believe this issue to be resolved; am I missing anything before I PReq? My patch is here.

nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
Hardfork guards are complex for this issue, because we can't access
chain time in the operation's get_required_active_authorities() method.

There was no apparent 'good' way to solve this, so I settled for a
fairly nasty hack which seemed the least bad of bad options. Add a
boolean parameter to the verify_authority() functions determining
whether the custom_operation::required_auths field should be ignored or
not, and call these functions setting the boolean appropriately for
whether we have passed the hardfork or not. This works because chain
time is available at the verify_authority() call sites.
@pmconrad
Copy link
Contributor

pmconrad commented Mar 1, 2019

Looks good at first glance. Please create PR to hardfork branch.

nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
Hardfork guards are complex for this issue, because we can't access
chain time in the operation's get_required_active_authorities() method.

There was no apparent 'good' way to solve this, so I settled for a
fairly nasty hack which seemed the least bad of bad options. Add a
boolean parameter to the verify_authority() functions determining
whether the custom_operation::required_auths field should be ignored or
not, and call these functions setting the boolean appropriately for
whether we have passed the hardfork or not. This works because chain
time is available at the verify_authority() call sites.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 1, 2019
Hardfork guards are complex for this issue, because we can't access
chain time in the operation's get_required_active_authorities() method.

There was no apparent 'good' way to solve this, so I settled for a
fairly nasty hack which seemed the least bad of bad options. Add a
boolean parameter to the verify_authority() functions determining
whether the custom_operation::required_auths field should be ignored or
not, and call these functions setting the boolean appropriately for
whether we have passed the hardfork or not. This works because chain
time is available at the verify_authority() call sites.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 4, 2019
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 6, 2019
Mostly polish, but one mistake fix as well.
@abitmore abitmore modified the milestones: Future Consensus-Upgrade Release, 201810-Consensus-Release Mar 13, 2019
@abitmore abitmore modified the milestones: 201810 - Consensus-Upgrade Release, 201911 - Consensus-Upgrade Release Mar 13, 2019
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Mar 13, 2019
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Jul 31, 2019
The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Jul 31, 2019
Hardfork guards are complex for this issue, because we can't access
chain time in the operation's get_required_active_authorities() method.

There was no apparent 'good' way to solve this, so I settled for a
fairly nasty hack which seemed the least bad of bad options. Add a
boolean parameter to the verify_authority() functions determining
whether the custom_operation::required_auths field should be ignored or
not, and call these functions setting the boolean appropriately for
whether we have passed the hardfork or not. This works because chain
time is available at the verify_authority() call sites.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Jul 31, 2019
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Jul 31, 2019
Mostly polish, but one mistake fix as well.
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Jul 31, 2019
nathanielhourt added a commit to nathanielhourt/bitshares-2 that referenced this issue Jul 31, 2019
nathanielhourt added a commit that referenced this issue Aug 13, 2019
Issue #210: Check required_auths on custom_operation
@nathanielhourt
Copy link
Contributor

This is merged to hardfork

jmjatlanta pushed a commit that referenced this issue Sep 3, 2019
The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.
jmjatlanta pushed a commit that referenced this issue Sep 3, 2019
Hardfork guards are complex for this issue, because we can't access
chain time in the operation's get_required_active_authorities() method.

There was no apparent 'good' way to solve this, so I settled for a
fairly nasty hack which seemed the least bad of bad options. Add a
boolean parameter to the verify_authority() functions determining
whether the custom_operation::required_auths field should be ignored or
not, and call these functions setting the boolean appropriately for
whether we have passed the hardfork or not. This works because chain
time is available at the verify_authority() call sites.
jmjatlanta pushed a commit that referenced this issue Sep 3, 2019
Mostly polish, but one mistake fix as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants