-
Notifications
You must be signed in to change notification settings - Fork 0
POW hash calculation #62
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
Conversation
…proved database management
…tate and improve state management
Maximkaaa
left a comment
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.
I also think we need at least one test that will check that the calculated hash is what is expected.
| } | ||
|
|
||
| /// Calculates POW hash based on the given trie state. | ||
| /// Calculates POW 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.
please add some tests
Maximkaaa
left a comment
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.
All looks fine. But I wonder, can we write a test to check the exact value of the hash. And have the same test in the EVM. To make sure that the calculation produces the same resullt in both code bases? Or is it impossible to mock exactly same state in both repos?
ufoscout
left a comment
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.
Please fix the existing conflicts so we can proceed with the review
ufoscout
left a comment
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.
@itsyaasir everything looks but I would like to add a new test:
- append to the blockchain a predetermined set of hardcoded blocks
- calculate the state root and check it is the expected hardcoded one
- calculate the pow and check it is the expected hardcoded one
A test with the same blocks and expected values should then be added to the evm-canister
ufoscout
left a comment
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.
@itsyaasir Bitfinity tests are failing in CI
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn test_pow_hash_with_empty_execution() { |
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.
all tests should be prefixed with bitfinity_
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.
Missed this! Thanks
No description provided.