-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor kairos-tx
#81
Conversation
Transaction happens on L1 directly, so nonce has no meaningful value for Kairos.
Deposit transaction is not counted for `nonce`, and we start with 0.
It will help with extracting data, without taking ownership of the whole transaction.
Minimum allowed coverage is Generated by 🐒 cobertura-action against 9fc5a00 |
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'm sure I'm missing context here, but why the name "der_encode" and "der_decode"?
Also these github actions are out of control, take far to long to run.
@Rom3dius Thanks! Let me provide you context 😉 Schema for Kairos transaction is defined as ASN.1:
Notably it's fully abstract syntax - there is no definition how those should be converted from and to bytes. However, ASN.1 is closely associated with multiple sets of encoding rules: BER, DER, CER, and others. DER-encoding is the one we are using, as it is fully deterministic, so we can have the exact same bytes representation that is implementation agnostic. |
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
You did not address the comments I left about some of the changed files in Avi's PR:
|
@marijanp I believe that simple change in Nix e2e tests was explained 3 days ago. You are usually not closing PR discussions that you started, so should I wait for you to click "resolve conversation"? Your objectives about |
I extracted great improvements of
kairos-tx
done by @Avi-D-coder in Trie integration, to reduce clutter in his PR.List of changes:
Deposit
,Withdrawal
,Transfer
,SigningPayload
- can be created with flexible constructor. Thushelpers.rs
got removed.SigningPayload
.One additional change that I made myself is to allow cloning the base fields, so we can extract nonce/amount/public-key without taking ownership of full transaction - 9fc5a00.