-
Notifications
You must be signed in to change notification settings - Fork 10
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
decentralization #43
base: develop
Are you sure you want to change the base?
decentralization #43
Conversation
be3385c
to
bb89048
Compare
src/orng.cpp
Outdated
for (auto resolver : job_resolvers) { | ||
auto resolver_node_itr = node_table.require_find(resolver.value, "Can not find resolver node to update job count"); | ||
node_table.modify(resolver_node_itr, same_payer, [&](auto& n) { | ||
n.job_count += 1; |
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.
Should we update this record when resolver submit the seed instead of?
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.
@porkchop What do you think? Should we count number of seed node has been submit for reward or just succeed job?
Also should we count failed job for node reward?
src/orng.cpp
Outdated
uint64_t sig_val{job_it->signing_value}; | ||
|
||
auto current_epoch_itr = resolveepoch(); | ||
auto resolvers = current_epoch_itr->resolvers; |
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 am wonder in the epoch race condition happen, there might be a case that resolvers come from 2 different epochs?
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.
resolvers come from 2 different epochs?
I'm not really understand, can you elaborate this?
Each time only one epoch active with specific choose random resolvers. In any cases that epoch can not pick resolvers (not enough active not ping) then that epoch will be skip.
} else { | ||
// if previous epoch can not resolve job, clear previous seeds and submit again in this epoch | ||
resolver_seeds.clear(); | ||
resolver_seeds.push_back({ resolver, rv_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.
should we update last_resolve_epoch for this job_id?
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 update last_resolve_epoch for this job_id here https://github.com/worldwide-asset-exchange/wax-orng/blob/decentralization/src/orng.cpp#L362
|
||
vector<JobSeed> resolver_seeds = job_it->resolver_seeds; | ||
if (job_it->last_resolve_epoch == epoch.id) { | ||
auto lower = std::lower_bound(resolver_seeds.begin(), resolver_seeds.end(), resolver, |
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.
what happen if the job_id already has final_hash but new resolver try to submit new one?
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.
That case I checked here https://github.com/worldwide-asset-exchange/wax-orng/blob/decentralization/src/orng.cpp#L300
"Could not verify signature."); | ||
|
||
epoch_seed_itr->signature = signature; | ||
epoch_signature_table.set(epoch_signature, get_self()); |
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 just wonder what if the last resolve change the public-key this time? it will change the signature as well?
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.
They will don't allow to change the updated public key, they only able to update next public key. The action for node to update key here https://github.com/worldwide-asset-exchange/wax-orng/blob/decentralization/src/orng.cpp#L498
|
||
check(job_it->final_hash != checksum256(), "Job has not been resolved yet"); | ||
|
||
action( |
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.
what happen if it throws error in this case?
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.
Oracle will catch that error here https://monica.thh.io/wax/wax-rng-oracle/-/blob/decentralize/lib/poller.js#L210.
And then after max retry time, it will report job fail execution using action jobsfail
.
After collect enough fail execution from all resolvers, that job will be deleted.
Change Description
Documentation Additions
Pushing The Code
Unit Test Coverage