-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add timestamp in node validation election #1590
Add timestamp in node validation election #1590
Conversation
3acc2df
to
8b6d24d
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.
LGTM
382fb45
to
22aedab
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.
I'm also wondering, in the ValidationContext, when a node cross validate the stamp, it ensure the timestamp is valid. This function could evolve since the timestamp should be the ref_timestamp shared by all validations node
4c0b0e8
to
76eb7ee
Compare
I now check for equality between the node's validation time and the corss validation time. For consistency, I also modified the following test/archethic/mining/validation_context_test.exs:252, from "should validate even if validation_time and cross_validation_time are in different oracle bucket" to "should not validate if validation_time and cross_validation_time are in different oracle bucket" and made sure ":timestamp" is present in the inconsistencies table. The test in test/archethic/mining/validation_context_test.exs:252 ("should validate with a valid validation stamp"), should handle the happy path for us without change. |
3912073
to
7aeb6e0
Compare
4557466
to
b212caf
Compare
Description
This pull request addresses an issue with the validation node election process. Currently, the election is based on transaction data and a daily nonce seed, which causes repeated selection of the same validation nodes for identical transactions throughout the day. If one of the validation nodes, especially the coordinator, has an incorrect state or is unable to retrieve required data, the transaction will fail validation for the entire day.
The solution implemented here introduces a timestamp into the election process to ensure that the elected nodes vary with each transaction attempt. The timestamp used is from the StartMining message, sent by the welcome node, which serves as a reference timestamp to diversify node election.
Fixes #1564
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The following tests were conducted to validate this change:
Checklist: