-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: sync up to latest micro-block #726
Conversation
def get_blocks_per_height(from_height, to_height) when is_integer(to_height) do | ||
{:ok, header} = :aec_chain.get_key_header_by_height(to_height + 1) | ||
|
||
last_mb_hash = :aec_headers.prev_hash(header) |
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.
There are some "empty" generations (without microblocks).
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.
this is contemplated by the get_blocks_per_height
, mbs will be an empty array
@@ -163,7 +166,7 @@ defmodule AeMdw.Sync.Server do | |||
|
|||
new_state_data = %__MODULE__{ | |||
state_data | |||
| mem_height: State.height(new_db_state), | |||
| mem_hash: State.height(new_db_state), |
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.
Implement something like State.height_hash
?
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.
this should have been set to nil
, ultimately the result was the same, but mem_hash
should have always been either a hash or nil
. Fixed now, thanks
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.
nice! optionally would rename or add comment for someone eventually debugging to indicate that it is already handling the case when last_mb_hash
= prev_kb_hash
No description provided.