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

Persist PXE state #3364

Closed
1 task
Tracked by #3366
alexghr opened this issue Nov 20, 2023 · 0 comments · Fixed by #3628
Closed
1 task
Tracked by #3366

Persist PXE state #3364

alexghr opened this issue Nov 20, 2023 · 0 comments · Fixed by #3628
Assignees

Comments

@alexghr
Copy link
Contributor

alexghr commented Nov 20, 2023

The PXE (Private eXecution Environment) is a component that lives on the user's device and is used to store private keys, private notes, private contract bytecode and sign transactions.

Currently the PXE is backed by an in-memory store so whenever it is restarted it 'forgets' all of the keys that were registered previously and all of the users notes and deployed contracts.

Add a new PXE database implementation alongside MemoryDB that persists its data.

Requirements

  • efficient storage/retrieval of notes
  • atomic writes
  • validate state on boot
  • hold users' keys

Data validation

The PXE syncs with the blockchain so on boot it should compare its own view of the world state (it holds the roots of the merkle trees) against the same block on the chain.

Questions

  1. How should it store private encryption keys in the database?
@alexghr alexghr self-assigned this Nov 20, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Nov 20, 2023
@alexghr alexghr moved this from Todo to In Progress in A3 Dec 1, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in A3 Dec 13, 2023
alexghr added a commit that referenced this issue Dec 13, 2023
This PR adds a persistent database to PXE. I've created a new package in
the monorepo called `@aztec/kv-store` which exports a set of general
data structures that can be used by components to store state in
consistent manner. The only implementation right now is with LMDB (both
persisted on disk and in-memory/temporary file).

This higher level abstraction allowed me to easily add storage to ~PXE's
note processors, its synchronizer and~ the key store too.

Fix #3364 

Changes to the synchronizer and note processors have been taken out and
will be merged in a separate PR (as part of #3570) because it will
require some changes to the benchmarking code.

Synch changes here #3673
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
This PR adds a persistent database to PXE. I've created a new package in
the monorepo called `@aztec/kv-store` which exports a set of general
data structures that can be used by components to store state in
consistent manner. The only implementation right now is with LMDB (both
persisted on disk and in-memory/temporary file).

This higher level abstraction allowed me to easily add storage to ~PXE's
note processors, its synchronizer and~ the key store too.

Fix AztecProtocol#3364 

Changes to the synchronizer and note processors have been taken out and
will be merged in a separate PR (as part of AztecProtocol#3570) because it will
require some changes to the benchmarking code.

Synch changes here AztecProtocol#3673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant