-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add built-in plugin signer #2
Conversation
… tx_view_to_basic_otx.
|
||
pub fn get_or_insert_otx_id(&mut self) -> Result<H256, OtxFormatError> { | ||
if let Some(key_pair) = self | ||
.meta |
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.
Performance suggestion: we can use map internally and serialize to key value pairs on serialization.
log::info!("on_new_open_tx, index otxs count: {:?}", context.otxs.len()); | ||
if let Ok(aggregate_count) = otx.get_aggregate_count() { | ||
log::info!("aggregate count: {:?}", aggregate_count); | ||
if aggregate_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.
Signer should not depend on aggregate_count
. If we need a signal to notify the signer, it's better to add a new key such as otx status, where PendingSignature
means the transaction is ready to sign.
); | ||
let _ = responder.send(MessageFromHost::Ok); | ||
} | ||
MessageFromPlugin::NewMergedOtx((merged_otx, otx_hashes)) => { |
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 mentioned in https://github.com/EthanYuan/open-transaction-pool/pull/2/files#r1164822517 , a meta key status
can eliminate many messages here. We should let the otx tells the next step instead of relying on the external states. If the plugin want to notify the next step, it just need to set a field in the otx and send it back to the pool.
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 some comments but they can be addressed in the following PRs.
Thanks! I'll address these comments in the following PRs. |
The following updates have been made to the payment plugin: