Skip to content
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

E2E test of Pente<->Noto integrated tokens with Bond sample #340

Merged
merged 158 commits into from
Nov 1, 2024

Conversation

peterbroadhurst
Copy link
Contributor

@peterbroadhurst peterbroadhurst commented Oct 26, 2024

Summary

Provides Domain-specific receipt information for completed transactions:

  • ptx_getTransactionReceipt - no change to content, but now available on all nodes
  • ptx_getStateReceipt - provides information about the the input/read/output/info states for a TX
    • Tells you if there are states associated with that TX that you do not know about
    • TODO: Nullifiers need to be added here later
  • ptx_getDomainReceipt - gives domain specific information about private transactions
    • For Pente gives you a transaction with the Ethereum transaction and receipt with an Ethereum receipt
    • The payload of both is as similar as possible to standard Ethereum, but is a subset
  • ptx_getTransactionReceiptFull - includes states and domainReceipt
    • Has domainReceiptError if unavailable, rather than erroring
  • ptx_call - now fully wired up for Pente private EVM contracts as well as public smart contracts
  • Utilities for decoding ABI encoded data using the dictionary of ABIs in Paladin (via ptx_upsertABI and sending txs):
    • ptx_decodeError
    • ptx_decodeCall
    • ptx_decodeEvent
    • ^^^ integrated into UI for private EVM Transactions if you upload the ABIs

Includes significant work from @awrichar in demonstrating the use of a Pente private EVM smart contract for sophisticated notarization of a Noto based token modeling a Bond.

Detailed work list built as I went through

  • Add recording of read states through Proto, Domain and State Manager
    • This is needed as we want
  • Build an API on State Manager to query all states for a confirmed transactions
    • Needs to handle DB complexity over the three tables we have (the three tables make state query function)
    • I've used a UNION ALL combined with RIGHT JOIN construct to join things on the DB side
    • Had to jump through some hoops to make this work for GORM
  • Provide a spelling so consumers of this API can know if all the states are available or not
  • Change the way Unit Test DBs are manager for Postgres
    • Check that the migrations delete all the DBs they create
    • Use a predictable DB per package (rather than one per test) - much easier to use psql to debug now 😅
    • Clean down the DB using DELETE FROM instead of DROP DB between tests - ⏩ test execution
  • Refactor Pente assembly ...
  • Build generic interface on to_domain proto interface to construct a receipt
    • This required introduction of a new info type of state emitted from a transaction
    • This type is not required to be available on-chain before the transaction
    • It is also not required to be available on-chain for subsequent transactions
    • It is written to the database and distributed as part of the transation
    • It is passed to Endorse and Receipt flows with the Domain
    • Thus it can be used to contain things like the Pente signed input of the transaction that is required for execution
    • Interesting that until this point, this thing that used to be the only thing Tessera wrote, was missing from our TXs that only recorded the chain input/output state, and not explicitly the signed input payload from the submitter.
  • Allow receipts to be stored, without the corresponding transaction
    • Includes adding domain to the receipts
    • This means that there is information available on other nodes that can be queried
    • This is different from base ethereum where you get the TX inputs and receipts, but I'm currently convinced this difference is justified
    • In the case of Pente, the receipts contain both the inputs + outputs of the transaction
  • Build a ptx_getTransactionReceiptFull or similar interface to call this
  • Implement for Pente - giving an near-identical to Ethereum receipt
    • Include contractAddress for deploys - unblocks E2E work
    • Include full EVM Event details
    • This included updating our execution to accumulate logs across all the executed frames, with the source address
  • Adds the function to allow a combined Noto<->Pente chained private transaction
  • Implement for Noto + Zeto (minimal)
    • Minimal is determined to be a suitable message for now
  • Add prepared transaction support
  • Various key manager enhancements
  • Updated deploy interface into Domains to have access to from information
  • Added JSON/RPC APIs for decoding calls and events, as well as errors
  • Added UX for seeing inside the private EVM using ^^^ APIs
  • Adds UI to build

jimthematrix and others added 30 commits October 15, 2024 14:03
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…confirmed TX states

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
peterbroadhurst and others added 23 commits October 30, 2024 22:12
Signed-off-by: John Hosie <john.hosie@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
…body

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
… issue

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Validate state hashes for the zeto domain
Signed-off-by: dwertent <david.wertenteil@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Copy link
Contributor

@hosie hosie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: John Hosie <john.hosie@kaleido.io>
@hosie hosie merged commit d50ea27 into main Nov 1, 2024
4 checks passed
@hosie hosie deleted the domain-receipts branch November 1, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants