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

refactor: consolidate datastore and burn datastore data #1562

Merged
merged 10 commits into from
Sep 30, 2024

Conversation

hugocaillard
Copy link
Collaborator

@hugocaillard hugocaillard commented Sep 19, 2024

fix: #1540

Description

The simnet memory datastore was only able to store blocks data for pre-nakamoto blocks (with 1 stacks block per burn block).
With this refactor, we now handle multiple stacks-block per burn block.

  • The Datastore becomes ClarityDatastore and holds the key/value store for Clarity data.
  • The BurnDatastore becomes the Datastore and holds all of the stacks block and burn blocks data
  • BlockInfo has been removed in favor of BurnBlockInfo and StacksBlockInfo

Copy link

codecov bot commented Sep 19, 2024

@tippenein
Copy link
Collaborator

I like where this is going. Was this in relation to some issue or just a cleanup?

@hugocaillard
Copy link
Collaborator Author

@tippenein
Thx!
This is to address an actual issue, but ended up being a way bigger refactor than I expected.

Basically we went realistc block times in simnet between burn blocks and between stacks blocks. We were only tracking one type of blocks so far (doesn't really matter which type, since we had a 1:1 relation between burn and stacks blocks).
So now we store burn_blocks and stacks_blocks, and we store realistic times for both.
The clarity_datastore basically only holds the MARF keys and values now, and the datastore stores burn and stacks blocks.
We know also have burn_block_info and stacks_block_info

@hugocaillard hugocaillard marked this pull request as ready for review September 24, 2024 13:45
tippenein
tippenein previously approved these changes Sep 24, 2024
krl
krl previously approved these changes Sep 26, 2024
Copy link

@krl krl left a comment

Choose a reason for hiding this comment

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

looks good

components/clarity-repl/src/repl/datastore.rs Show resolved Hide resolved
components/clarity-repl/src/repl/clarity_values.rs Outdated Show resolved Hide resolved
@hugocaillard hugocaillard dismissed stale reviews from krl and tippenein via 90d5df2 September 26, 2024 12:40
@hugocaillard hugocaillard requested review from tippenein and krl and removed request for csgui September 26, 2024 13:47
Copy link
Contributor

@csgui csgui left a comment

Choose a reason for hiding this comment

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

I verified the datastore changes, and they seem to be ok. I added some remarks that could be improved, if applicable.

components/clarity-repl/src/repl/datastore.rs Show resolved Hide resolved
components/clarity-repl/src/repl/datastore.rs Show resolved Hide resolved
components/clarity-repl/src/repl/datastore.rs Outdated Show resolved Hide resolved
components/clarity-repl/src/repl/datastore.rs Outdated Show resolved Hide resolved
@hugocaillard hugocaillard requested review from csgui and removed request for obycode September 27, 2024 09:50
Copy link
Contributor

@csgui csgui left a comment

Choose a reason for hiding this comment

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

Changes on datastore LGTM!

@hugocaillard hugocaillard merged commit c56b2d4 into main Sep 30, 2024
19 checks passed
@hugocaillard hugocaillard deleted the fix/clarity-3-simnet branch September 30, 2024 08:32
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 this pull request may close these issues.

Properly handle burn-block, stacks-block, and tenure info in simnet
4 participants