-
Notifications
You must be signed in to change notification settings - Fork 1
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
proactive refresh #413
proactive refresh #413
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
c3bbd2e
to
f0500ad
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.
😎 love this
get_signer(&app_state.kv_store).await.map_err(|e| ProtocolErr::UserError(e.to_string()))?; | ||
check_in_registration_group(&validators_info, signer.account_id()) | ||
.map_err(|e| ProtocolErr::UserError(e.to_string()))?; | ||
// TODO: validate this endpoint |
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.
is this TODO already done with the line above? Or do you mean check that this http request actually came from the chain?
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.
the latter, I created a todo card on our board.....will pick it up when things calm down a bit I just wanted to leave a todo in the code too
for key in all_keys { | ||
let sig_request_address = AccountId32::from_str(&key).map_err(ProtocolErr::StringError)?; | ||
|
||
// TODO: check key visibility don't do private (requires user to be online) |
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.
To do this, get_all_keys
could also return key visibility - or we make a similar function get_non_private_keys
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.
oh ya, that would be a good idea......would be fun to I wrote this function a while ago but if I recall correctly it reads the raw state of the chain's db and may need to be decoded
let sig_request_address = AccountId32::from_str(&key).map_err(ProtocolErr::StringError)?; | ||
|
||
// TODO: check key visibility don't do private (requires user to be online) | ||
// key should always exist, figure out how to handle |
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 have no idea how to handle this, but if we return an error if exists_result
is false, it will at least show up in the chain logs as getting an unexpected status code.
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.
mmmmm Im not sure I care about that, it is a nice to fix but doesn't....like im down to put it as a back burner todo
let deserialized_old_key: KeyShare<KeyParams> = deserialize(&old_key_share) | ||
.ok_or_else(|| ProtocolErr::Deserialization("Failed to load KeyShare".into()))?; | ||
|
||
let new_key_share = do_proactive_refresh( |
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.
as this can take a long time, it might be worth spawning a task to run this and already responding, to avoid problems with the two second deadline set in the propagation pallet.
although if there haven't been any problems with this in tests maybe we don't need to worry.
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.
yes, there hasn't and Im down to put it in its own thread, once we decide if and how we tell the chain later if things are done (as the threading will effect that). Also even if the deadline is met wouldn't the process still continue and the server end until completion
* master: Write a Dockerfile that can build both `entropy` and `server`. (#430) Workflow for automated GitHub Release drafting/publishing. (#429) Update `.editorconfig` to match `.rustfmt.toml` settings (#427) Place `demo_offence` dispatchable behind root origin check (#426) Ensure correct validator order by using ValidatorInfo from chain rather than from user (#425) changed remaining references of --ws-external to --rpc-external Update README.md proactive refresh (#413)
#412
To do in subsequent PRs