-
Notifications
You must be signed in to change notification settings - Fork 648
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
Issue #210: Check required_auths on custom_operation #1629
Issue #210: Check required_auths on custom_operation #1629
Conversation
libraries/chain/include/graphene/chain/protocol/transaction.hpp
Outdated
Show resolved
Hide resolved
libraries/chain/include/graphene/chain/protocol/transaction.hpp
Outdated
Show resolved
Hide resolved
libraries/chain/include/graphene/chain/protocol/transaction.hpp
Outdated
Show resolved
Hide resolved
OK, did I get everything? I did some refactoring in |
b78ccaf
to
0ba8257
Compare
Please rebase on latest hardfork branch. |
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.
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.
Mostly polish, but one mistake fix as well.
0ba8257
to
6770103
Compare
d487bf8
to
48a5457
Compare
OK, this should be ready. Let me know if I missed anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but one more thing:
Docker build is consistently failing in db_notify.cpp because it it doesn't know the MUST_IGNORE_CUSTOM_OP_REQD_AUTHS
macro. I think db_notify.cpp
must include hardfork.hpp
(db_block.cpp
does include it and is compiled successfully).
The difference between Travis and Docker is that Docker uses -DGRAPHENE_DISABLE_UNITY_BUILD=ON
but Travis doesn't. I. e. Travis compiles all db_*.cpp
in one go which means that the include
in db_block.cpp
also works for db_notify.cpp
. Docker compiles db_notify.cpp
separately, so the include is missing.
This PR resolves issue #210. See issue for discussion.