-
Notifications
You must be signed in to change notification settings - Fork 20
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
Blockchain: add alt-block handling #260
Conversation
329a38b
to
e1ae848
Compare
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.
Will review again.
Co-authored-by: hinto-janai <[email protected]>
pub weight: u64, | ||
pub weight: usize, |
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.
Is there a reason things are mostly usize
instead of u64
? Here but also across the codebase in general, e.g. DB service messages.
They are required to be u64
elsewhere (especially in RPC) and these usize
s permeate and cause usize_to_u64()
to be everywhere. I understand indices but these aren't that. Can we start using u64
instead?
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's a trade of between what type is needed more, I used to use u64
s everywhere but I changed it here: #201 and I do remember there being an improvement.
This is a weight which is often calculated by getting the size of a Vec, which is given in a usize
. Plus you could change the JSON types to be usize
s right?
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.
Changing this actually removed multiple conversions in the DB
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 types are defined as 64-bit in monerod
, I don't think defining public fields within public RPC types as usize
is a good tradeoff. Probably won't affect many machines but not worth it IMO. I'm okay with using the cast functions if these need to be usize
elsewhere.
What
Adds alt block handling to the blockchain storage.
How
Follows #194