-
Notifications
You must be signed in to change notification settings - Fork 166
feat: Local ledger implementation in typescript #2623
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: main
Are you sure you want to change the base?
Conversation
3bc3feb to
2bf4a1a
Compare
49d049e to
cf81984
Compare
| await txn.sign([feePayer1.key]).send(); | ||
| } catch (err: any) { | ||
| handleError(err, 'Account_delegate_precondition_unsatisfied'); | ||
| handleError(err, 'delegate precondition'); |
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.
this breaks when using the local ledger because our error messages are slightly different. This is probably bad :((
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.
No this should actually be fine! Because we also want to improve the error messages and overall error handling. That being said, we should be able to make the error messages "backwards compatible" via something like this throw Error('Account_delegate_precondition_unsatisfied: ....');
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.
only sorting imports
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.
we actually lose some information during the
v1 -> v2 -> v1 transformation :((
the timing field has a boolean in it that isn't transferred around, and zkappversion and lastActionSlot are lost 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.
we can change the logic of the transformation, should be fine since its not finished yet and under experimental anyway
|
our add function was all sorts of wrong |
cf81984 to
0a37c9c
Compare
|
Status quo: verification key hash does not match, nor does the removed both checks from applytransaction, everything else seems to work |
| checkPrecondition<PublicKey>('delegate', preconditions.account.delegate, account.delegate); | ||
| checkPrecondition<Bool>('isProven', preconditions.account.isProven, account.zkapp.isProven); | ||
| checkPrecondition<Bool>('isNew', preconditions.account.isNew, new Bool(account.isNew.get())); | ||
| // checkPrecondition<Bool>('isNew', preconditions.account.isNew, new Bool(account.isNew.get())); |
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 logic is a little iffy here, something is a bit strange, needs to be investigated
| // if (!account.zkapp.verificationKey.hash.equals(update.verificationKeyHash).toBoolean()) | ||
| // errors.push( | ||
| // new Error( | ||
| // `account verification key does not match account update's verification key (account has ${account.zkapp.verificationKey.hash}, account update referenced ${update.verificationKeyHash})` | ||
| // ) | ||
| // ); |
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 verification key hash isn't lining up either, something is weird
|
hmm, account deployment still broken |
If converting between v1 and v2 is too annoying we can just copy&paste the v2 transaction logic into v1 and make it v1 type compatible - thats fine as well |
Moving from OCaml local ledger to JS local ledger