-
Notifications
You must be signed in to change notification settings - Fork 95
Ticking without ARB packet / Improvement on computorlist #356
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
base: develop
Are you sure you want to change the base?
Ticking without ARB packet / Improvement on computorlist #356
Conversation
- Add self-generated computor list and related flags - Implement saving of future computors at end of epoch for next epoch use - Update beginEpoch to use self-generated computor list when available - Modify processBroadcastComputors to compare ARB list with self-generated list - Modify tickProcessor to handle self-generated computor list scenarios - Add warnings and debug messages for unverified self-generated lists - Update main loop to display warning for unverified self-generated lists This commit allows the network to continue ticking with a self-generated computor list in the case of seamless transition when the ARB list is not available, improving network resilience while maintaining the ability to verify against the official ARB list when received.
- Add logic to maintain indices for computors keeping their status - Introduce temporary arrays to manage computor list reorganization - Implement two-phase approach for computor list generation: 1. Preserve indices for continuing computors 2. Fill remaining spots with new computors - Add error handling for unexpected scenarios - Update selfGeneratedComputors with the newly organized list This commit ensures that computors maintaining their status across epochs keep their original indices, while new computors are assigned to the remaining available slots. This change enhances the continuity and predictability of the network's computor assignment process.
Instead of allocating seperate memory for the temporary computor list we use the reorgBuffer. This also solves a problem where the compiler tries to optimize the function with the use of memset, which is not available.
Flag is not used.
In the case that the computorlist is self generated and not signed by the arbitrator we do not send computorlist to other nodes.
In case that the self-generated computorlist and the list of ARB is different. If a new list of ARB is broadcasted which matches continue ticking again.
Fix issues during review. Make use of clang-format with style 'Microsoft' for formating. Switch bs->SetMem and bs->CopyMem to setMem and copyMem functions.
- Fix pointer error in `copyMem()` function - Use `useSelfGeneratedComputors` to decide if computor list is broadcasted - Add a comment about the sorting of `minderPublicKeys` - Initialise `selfGeneratedComputors` array with 0s - Fix index assignment for new computors - Disable begin of epoch assert all minderPublicKeys == 0 for self-generated computor list - Reduce log spamming when using self-generated computor list - Change `NULL` to `nullptr` in `platform/memory.h`
During epoche change futureComputors will be filled with computed computors. This handles the edge case when another epoche change happens before any solution is submitted.
If the computor list is self generated request broadcastedComputors to receive list of ARB if it exists.
Reallows the transmission of computorlist even if list is selfGenerated. It will not be accepted if the list is not signed by ARB
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.
Looks good to me. I just have two minor comments.
src/qubic.cpp
Outdated
} | ||
else | ||
{ | ||
// Handle error; something went wrong |
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 would add/keep a #ifndef NDEBUG
with addDebugMessage()
here.
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.
Added.
Also added a todo to discuss if on this failure the use of the self-generated computorlist should be turned off.
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.
Good idea. IMO you can uncomment it (for not using self-generated computorlist).
This commit adds a special command to ignore the self-generated computorlist during the next start. This allows to recover from a critical situation qubic#2. On a critical situation qubic#2 send special command with qubic-cli. Shutdown Qubic properly (escape key) to save systemfile On the next restart (if systemfile is present) the self-generated computor list is ignored.
Overview
This PR implements a mechanism for nodes to compute and validate their own computorlist during epoch transitions.
Key Features
EndEpoch()
andStartEpoch()
, usingsystem.futureComputors
useSelfGeneratedComputor
flag to track computorlist status and ARB signature verificationselfGeneratedComputors
anduseSelfGeneratedComputors
are added to thesystem
structTesting