-
Notifications
You must be signed in to change notification settings - Fork 100
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
data structure deep dive #705
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
## The Ledger | ||
|
||
"The ledger" or "the ledger history" is the totality of all the state transitions that have ever happened on the blockchain. | ||
In theory, with merely the transactions themselves one can recalculate whatever happened at any point in time in |
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 sentence appears to be cut off mid-thought. Please complete the explanation of how transactions can be used to recalculate historical blockchain state. This will help readers better understand the relationship between transactions and state reconstruction.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
One can access resources in various ways: | ||
|
||
```move filename="Accessing state storage" | ||
use 0x1::res::Res; // Load the module `0x1::res` to get the defiition of `Res`. |
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.
There appears to be a typo in the comment - defiition
should be definition
in the line:
use 0x1::res::Res; // Load the module `0x1::res` to get the defiition of `Res`.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
fun table_example() { | ||
let table = MyStruct[@0xcafe].table; // reference a table in a resource | ||
table.insert(0, 1); // insert a key-value pair to the table, residing in a seperate state slot |
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.
There is a typo in the code comment - seperate
should be spelled separate
in:
table.insert(0, 1); // insert a key-value pair to the table, residing in a seperate state slot
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
See more about tables here [Tables](../../../build/smart-contracts/table). | ||
|
||
Various advanced data structures in the Aptos Framework are implemented base on tables, for example: [SmartVector](../../../build/smart-contracts/smart-vector). |
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.
There appears to be a minor grammatical error: "base on" should be "based on" in the sentence describing table-based data structures.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
a4b6ff5
to
46d3ac8
Compare
A transaction can be submitted | ||
Only "accepted" transactions are recorded in the ledger, on the contrary, "discarded" transactions are not part of the | ||
ledger and it's only possible to know |
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.
These sentences appear incomplete and cut off mid-thought. Please complete the explanation of:
- What a transaction can be submitted to
- What information is available about discarded transactions
This will help readers better understand the transaction lifecycle and how to handle failed transactions.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
See more about tables here [Tables](../../../build/smart-contracts/table). | ||
|
||
Various advanced data structures in the Aptos Framework are implemented base on tables, |
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.
Small typo: "base" should be "based" in "are implemented base on tables"
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
Description
Checklist
pnpm spellcheck
?pnpm fmt
?pnpm lint
?