-
Notifications
You must be signed in to change notification settings - Fork 647
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
Resolve #1506: Break protocol off into its own library #1737
Conversation
libraries/plugins/account_history/include/graphene/account_history/account_history_plugin.hpp
Outdated
Show resolved
Hide resolved
Docker build fails with
|
The travis build works. Both docker and travis are on Ubuntu-16.04 with gcc-5.4.x and boost-1.58.0. |
OK, requested changes applied, and I think the build should be fixed. |
Allows the more concise expression `object_downcast_t<xyz>` instead of the old `typename object_downcast<xyz>::type`
The ID types, object_id and object_id_type, were defined in the db library, and the protocol library depends on db to get these types. Technically, the ID types are defined by the protocol and used by the database, and not vice versa. Therefore these types should be in the protocol library, and db should depend on protocol to get them. This commit makes it so.
....aaaand Travis timed out.... |
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.
Mostly looks good. Thanks a lot!
|
||
#define GRAPHENE_MAX_SIG_CHECK_DEPTH 2 | ||
|
||
#define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT) |
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.
IMHO this doesn't belong to protocol.
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.
It determines fork validity... I think it would be interesting to a third party implementation. Otherwise they would have to replicate this number in their own project, or risk their implementations following a fork that the reference implementation won't follow.
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.
The line between protocol and implementation is somewhat blurred. We have lots of consensus logic in the implementation, and all of it determines block validity.
I lean a bit towards @abitmore in this case. The threshold is only helpful for the local node, in that it defines any fork that goes back beyond LIB to be invalid. But an independent observer given two forks cannot decide which one is "real". Therefore the value is irrelevant wrt the protocol.
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.
See above.
Define macros to fully de-boilerplate ID type definitions. Externalities: - Rename transaction_object -> transaction_history_object - Rename impl_asset_dynamic_data_type -> impl_asset_dynamic_data_object_type - Rename impl_asset_bitasset_data_type -> impl_asset_bitasset_data_object_type The first is to avoid a naming collision on transaction_id_type, and the other two are to maintain consistency with the naming of the other types.
OK, I've made some macros that eliminate all the boilerplate around the ID types, enums, and typename reflection. How does that look? |
Looks good to me.
|
Huh, never seen that before... Easy fix, though. :) |
cli_tests fails. |
I have no idea how that happened... Oops! |
Docker build timed out. Restarted. :-/ |
Did it time out again? At least travis finally passed. |
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 to me. Don't know why Docker Cloud failed.
This pull moves the
chain/protocol
folder into its own library, formalizing the separation between the protocol and the implementation. #1506Notable architectural changes:
xyz_object
types fromobject_id<>
template and replace with a mapping ofobject_id<>
toxyz_object
type which is defined in the header that definesxyz_object
object_id_type
andobject_id<>
fromdb
library toprotocol
, makedb
depend onprotocol
rather than vice versa