-
Notifications
You must be signed in to change notification settings - Fork 286
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
Generalized state compression #470
Generalized state compression #470
Conversation
…o smaller sections for easy understanding
…velopment process
… development process
… development process
… development process
… App with Generalized State Compression
…a Note-Taking App with Generalized State Compression
…ection for Building a Note-Taking App with Generalized State Compression
…section for Building a Note-Taking App with Generalized State Compression
…s section for buiding a Note-Taking App with Generalized State Compression
…on for Building a Note-Taking App with Generalized State Compression
…n for Building a Note-Taking App with Generalized State Compression
…n for Building a Note-Taking App with Generalized State Compression
…king App with Generalized State Compression
Zero update on this? |
@danielAsaboro we had a live course in NY with 24 people learning new material, then Rustconf then Breakpoint! Reviewing this now. |
Hi Mike, i've implemented the changes you suggested, |
@danielAsaboro I'm going to do a final review of this now, but can you also please fix the recent conflicts? Thanks! please also remove changes to the package.lock and other unrelated files. |
Hi Mike, it's great to hear from you again. To be clear, when you say 'remove changes to the package.lock and other unrelated files', do you mean i should revert the PR i made to unbox? |
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.
Great! Lots of small things but they're pretty easy. Give me a buzz once done and we'll get this in!
To be clear, when you say 'remove changes to the package.lock and other unrelated files', do you mean i should revert the PR i made to unbox?
No, this I mean you shoudl remove the two files that aren't .md
files in this PR
Your code is now in https://github.com/solana-developers/anchor-compressed-notes. Note that I think you're just using 'main' rather than 'solution' for your changes. We can get rid of the 'solution' branch if you're not using it (as long as the URL in this lesson is correct).
BTW @danielAsaboro I'm on telegram and twitter as mikemaccana
if you want to communicate faster.
content/courses/state-compression/generalized-state-compression.md
Outdated
Show resolved
Hide resolved
content/courses/state-compression/generalized-state-compression.md
Outdated
Show resolved
Hide resolved
content/courses/state-compression/generalized-state-compression.md
Outdated
Show resolved
Hide resolved
|
||
### Key Parameters for Configuring a Concurrent Merkle Tree | ||
|
||
As a program architect, you are responsible for controlling three key parameters |
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 a program architect, you are responsible for controlling three key parameters | |
As a developer, you are responsible for controlling three key parameters |
1. **Default Anchor Setup**: Configure the basic environment for Anchor testing. | ||
2. **Merkle Tree Keypair**: Generate a keypair for the Merkle tree. | ||
3. **Tree Authority**: Create a keypair for the authority of the Merkle tree. | ||
4. **Notes**: Define some sample notes to use in the tests. | ||
|
||
```typescript | ||
describe("compressed-notes", () => { | ||
const provider = anchor.AnchorProvider.env(); | ||
anchor.setProvider(provider); | ||
const connection = new Connection( | ||
provider.connection.rpcEndpoint, |
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.
Can spl-account-compression work against localhost?
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.
yes, they are designed to work local development environments..
please correct me if i'm are wrong
}); | ||
``` | ||
|
||
Next, we'll create the `Add Max Size Note` test. It is the same as the previous | ||
test, but with the second note. | ||
Next, let's create the `Add Max Size Note` test. This test will be similar to |
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 name of this test is now adds max size note to the Merkle tree
. Please update the tests names used in your text to match your new and better names.
}); | ||
``` | ||
|
||
Lastly, we'll create the `Update First Note` test. This is slightly more complex | ||
than adding a note. We'll do the following: | ||
Lastly, let’s create the `Update First Note` test. This test involves a few more |
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.
Eg updates the first note in the Merkle tree
- go through all of them
const noteLog = await getNoteLog(connection, txSignature); | ||
const hash = getHash(updatedNote, provider.publicKey); | ||
// Instruction to initialize the tree through the Note program | ||
const ix = await program.methods |
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.
Please use instruction, transaction, signature etc. See CONTRIBUTING.md
|
||
If you'd like a very simple example of a delete function, check out the | ||
For a straightforward example of how to implement a delete function, check out | ||
the | ||
[`solution` branch on GitHub](https://github.com/Unboxed-Software/anchor-compressed-notes/tree/solution). |
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.
Per the superteam bounty, this repo should be updated to the latest version of Anchor and you should test it still works
hmmm, this one took my tiime...I had an issue with checks when i remove my package json and yarn lock out; perhaps, anyone could help fix |
Hi Mike, I already reached out to you through Twitter 💙 |
* chore: updated lesson title, and summary * chore: updated lesson and theoretical overview of state compression * chore: updated lesson on concurrent merkle tree and broke it down into smaller sections for easy understanding * chore: updated lesson on data access in a state-compressed program and tooling * chore: updated lesson on indexing data for easy lookup * chore: updated lesson on creating rust types for compression development process * chore: updated lesson on initializing a new tree for compression development process * chore: updated lesson on adding hashes to the tree for compression development process * chore: updated lesson on adding hashes for compression development process * chore: updated lesson on updating and deleting hashes for compression development process * chore: updated lesson on updating and deleting hashes for compression development process * chore: updated lesson on accessing data from a client for compression development process * chore: update project setup in Lab section for Building a Note-Taking App with Generalized State Compression * chore: update step 2: define note schema in Lab section for Building a Note-Taking App with Generalized State Compression * chore: update step 3: define input account and constraints - in Lab section for Building a Note-Taking App with Generalized State Compression * chore: update step 4: create "create_note_tree" instruction - in Lab section for Building a Note-Taking App with Generalized State Compression * chore: update step 5: create "append_note_tree" instructuion - in Labs section for buiding a Note-Taking App with Generalized State Compression * chore: update step 6: create "update_note" instruction - in Lab section for Building a Note-Taking App with Generalized State Compression * chore: update step 7: "client test setup" instruction - in Lab section for Building a Note-Taking App with Generalized State Compression * fix: update step 7 for more info into the utility file provided * chore: update step 8: "write client test" instruction - in Lab section for Building a Note-Taking App with Generalized State Compression * chore: update challenge section in Lab section for Building a Note-Taking App with Generalized State Compression * fix: fixed content formatting issues * fix: used grammarly to fix grammar issues * fix: fixed on-chain to onchain * fix: fixed lack of objectives semantic tag after title section * fix: fixed description semantic tag issue * Update content/courses/state-compression/generalized-state-compression.md Fixed Merkle tree description summary Co-authored-by: Mike MacCana <[email protected]> * fix: fixed concurrent tree explanation markdown * fix: fixed grammar issue in last intro to theoretical overview of state compression * fix deterministic with predictably * Update content/courses/state-compression/generalized-state-compression.md Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md Made the intro more clearer Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md reinforce that the final hash is called a Merkle root Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md removed redundant explanation of merkle tree Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md fixed redundant word "entire" Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md called out the concurrent modifier in a merkle tree Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md removed redundant establishment of concurrent merkle tree as the solution to dealing with multiple transactions in the same slot Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md remove redundant explanation of a concurrent merkle tree Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md corrected incorrect information of what is logged to the Noop Program Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md clarified what the Solana Noop Program is to the reader Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md added code blocks to file names, config option, and package names Co-authored-by: Mike MacCana <[email protected]> * Update content/courses/state-compression/generalized-state-compression.md rename functions that handle instructions as function handlers as per the CONTRIBUTING.md guidelines Co-authored-by: Mike MacCana <[email protected]> * fix: fixed formatting issues * fix: broke down content * fix: reflected Mikes suggestion * fix: fixed all rust content and addded extra documentation * fix: updated the client side test, and made more explicit for clarity * fix: fixed grammar issues with header semantic tag content * fix: rephrased what state compression is per mikes suggestion * fix: fix grammar and vocab issues * fix: fixed instructional handler issue * fix: fixed redundancies in test files * fix: redirected them to main branch from solution branch * fix: added package.json and yarn lock * revert: revert package json and yarn lock to main state --------- Co-authored-by: Mike MacCana <[email protected]>
Problem
The documentation initially contained complex language and passive voice, making it difficult for beginners to understand. However, the code was functioning correctly once the dependencies were updated to their latest versions.
Summary of Changes