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

[r2r] fix rick and morty genesis block deserialization #1647

Merged
merged 7 commits into from
Feb 20, 2023

Conversation

borngraced
Copy link
Member

deserialization was failing for RICK's genesis block exclusively so I found out that the block header version(1) in the genesis block is different from other blocks(4).

Fixes: #1640

Signed-off-by: borngraced samiodev@icloud.com

Signed-off-by: borngraced <samiodev@icloud.com>
@borngraced borngraced self-assigned this Feb 6, 2023
@borngraced borngraced changed the title fix rick genesis block deserialization [r2r] fix rick genesis block deserialization Feb 6, 2023
Signed-off-by: borngraced <samiodev@icloud.com>
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for finding this bug! The below test is failing after the changes in this PR, please fix it!
https://github.com/KomodoPlatform/atomicDEX-API/blob/c02c8d1dbbd09b2eb8587e81198eaa76839d5cf7/mm2src/mm2_bitcoin/chain/src/block_header.rs#L433

mm2src/mm2_bitcoin/chain/src/block_header.rs Outdated Show resolved Hide resolved
mm2src/mm2_bitcoin/chain/src/block_header.rs Outdated Show resolved Hide resolved
Signed-off-by: borngraced <samiodev@icloud.com>
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more change!

mm2src/mm2_bitcoin/chain/src/block_header.rs Outdated Show resolved Hide resolved
Signed-off-by: borngraced <samiodev@icloud.com>
shamardy
shamardy previously approved these changes Feb 6, 2023
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @borngraced I think we need to bump this issue #1345 to avoid adding more variants in the future, you can work on it in the next sprint along spv.

caglaryucekaya
caglaryucekaya previously approved these changes Feb 15, 2023
Copy link

@caglaryucekaya caglaryucekaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sergeyboyko0791
Copy link

sergeyboyko0791 commented Feb 15, 2023

Is this problem also valid for other KMD asset chains, for example, MORTY?

@borngraced
Copy link
Member Author

Is this problem also valid for other KMD asset chains, for example, MORTY?

I'm unsure about any other assets but I'll make some test tomorrow with some other assets

@caglaryucekaya
Copy link

I just checked it, MORTY has the same problem

@borngraced
Copy link
Member Author

I just checked it, MORTY has the same problem

tysm! @caglaryucekaya 😃

Signed-off-by: borngraced <samiodev@icloud.com>
@borngraced
Copy link
Member Author

@sergeyboyko0791 @caglaryucekaya @shamardy this is review for further review again after fixing MORTY

@sergeyboyko0791
Copy link

I think we could merge this fix for RICK and MORTY coins, but later such functionality should not be hardcoded but configured in the coins file.

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Please consider my suggestions

mm2src/mm2_bitcoin/chain/src/block_header.rs Outdated Show resolved Hide resolved
mm2src/mm2_bitcoin/serialization/src/reader.rs Outdated Show resolved Hide resolved
mm2src/mm2_bitcoin/serialization/src/reader.rs Outdated Show resolved Hide resolved
@borngraced
Copy link
Member Author

borngraced commented Feb 16, 2023

I think we could merge this fix for RICK and MORTY coins, but later such functionality should not be hardcoded but configured in the coins file.

yes, I will take a look at this during the next sprint. #1345

Signed-off-by: borngraced <samiodev@icloud.com>
@borngraced borngraced changed the title [r2r] fix rick genesis block deserialization [r2r] fix rick and morty genesis block deserialization Feb 17, 2023
@borngraced borngraced mentioned this pull request Feb 17, 2023
@shamardy shamardy merged commit 5408130 into dev Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants