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

data structure deep dive #705

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

data structure deep dive #705

wants to merge 1 commit into from

Conversation

msmouse
Copy link
Contributor

@msmouse msmouse commented Nov 12, 2024

Description

Checklist

  • Do all Lints pass?
    • Have you ran pnpm spellcheck?
    • Have you ran pnpm fmt?
    • Have you ran pnpm lint?

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
developer-docs-nextra ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 0:21am

## 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
Copy link

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`.
Copy link

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
Copy link

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).
Copy link

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.

@msmouse msmouse changed the title temp data structure deep dive Nov 13, 2024
Comment on lines +38 to +40
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
Copy link

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:

  1. What a transaction can be submitted to
  2. 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,
Copy link

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.

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.

1 participant