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

State parsing MVP #2

Merged
merged 8 commits into from
Sep 6, 2024
Merged

State parsing MVP #2

merged 8 commits into from
Sep 6, 2024

Conversation

seanmcgary
Copy link
Collaborator

No description provided.

// 4. Determine which rows from the previous block should be carried over and which shouldnt (i.e. deregistrations)
// 5. Geneate the final state by unioning the carryover and the new registrations
// 6. Insert the final state into the registered_avs_operators table
func (a *AvsOperators) WriteFinalState(blockNumber uint64) error {

Choose a reason for hiding this comment

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

are you writing every value for every slot at every block? I'm confused whiy this is so big

// 3. Create a merkle tree for each AVS, with the operator:block_number pairs as leaves
// 4. Create a merkle tree for all AVS trees
// 5. Return the root of the full tree
func (a *AvsOperators) GenerateStateRoot(blockNumber uint64) (StateRoot, error) {

Choose a reason for hiding this comment

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

I was expectniig the state root to be a hash on the DIFF in a per block, it almost looks like with this you are producing the state root since genesis?

Choose a reason for hiding this comment

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

if that is the case producing the state root will take longer and longer. I expected the state root to just be a dumb hash of each table/row change or something simple like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can definitely switch to doing just the diffs, not a major change at all.

@seanmcgary seanmcgary merged commit ff64d36 into master Sep 6, 2024
1 of 2 checks passed
seanmcgary added a commit that referenced this pull request Oct 8, 2024
# This is the 1st commit message:

Calculate rewards

Add state change table for AVS operators to make windowing easier

Convert avs operator windows query to sqlite

Queries for snapshots

Testing OperatorAVSRegistrationWindows

Window query passing

Some cleanup

Expand test dataset to be more than just up to 2024-09-01

Restaked strategy snapshots

Test tweaks

Generate snapshots rather than windows

Add custom sum_big function

Adding tests for operator share snapshots

Change operatorShares to be a sparse table

Change StakerShares to a sparse table

Add snapshot generation for operator shares

Calculate rewards

remove git attributes

# This is the commit message #2:

Adding query stubs

# This is the commit message #3:

Adding more custom functions for math

# This is the commit message #4:

Copy over queries for gold table generation

# This is the commit message #5:

Use custom sql functions

# This is the commit message #6:

Use file-based db for testing rewards

# This is the commit message #7:

Staker amounts for nile and amazon forks

# This is the commit message #8:

Calculation testing

# This is the commit message #9:

Floating point math is the absolute worst

# This is the commit message #10:

Fix compliation

# This is the commit message #11:

More number tests

# This is the commit message #12:

Trying to get sqlite lib working

# This is the commit message #13:

This compiles and runs

# This is the commit message #14:

Also compiles

# This is the commit message #15:

Compiles and runs with added python stuff

# This is the commit message #16:

Delete compiled stuff

# This is the commit message #17:

Python seems to be working

# This is the commit message #18:

Working pre_nile_tokens_per_day

# This is the commit message #19:

Works with go example

# This is the commit message #20:

Port amazonStakerTokenRewards to native C

# This is the commit message #21:

Port nile_staker_token_rewards to native C

# This is the commit message #22:

Port amazon_operator_token_rewards and nile_operator_token_rewards to native C

# This is the commit message #23:

Rename yolo to calculations

# This is the commit message #24:

Add pure functions for easier testing

# This is the commit message #25:

Token calcuations test works
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.

2 participants