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

Use the snapshot cycle first block level to get the block. #596

Merged

Conversation

novalis
Copy link
Contributor

@novalis novalis commented Apr 29, 2022

With short cycles, the current level might be in a different cycle, causing the RPC to fail.

  • Analysis: I am trying to make tezos-reward-distributor work with private Tezos chains. During testing, I set my blocks_per_cycle to 8 (instead of the normal 8192). This makes testing much quicker, as one only needs to wait a few minutes to get enough blocks baked to do a distribution. But I noticed that requests were failing. One such failing request was to http://my-private-tezos-node/chains/main/blocks/14396/context/selected_snapshot?cycle=1795 I noticed that block 14396 should not be in cycle 1795 (with a cycle length of 8). This led me to this funny bit of code.

  • Solution: For a parameter named snapshot_cycle_first_block_level, use a variable named snapshot_cycle_first_block_level not current_cycle

  • Performed tests: After this change, tezos-reward-distributor gets further in distributing rewards (it still doesn't work, but that might be a config issue on my side).

Work effort: 3 hours (mostly spent learning what any of this code was doing, and figuring out how to get reasonable error messages -- see #597).

With short cycles, the current level might be in a different cycle, causing
the RPC to fail.
@nicolasochem
Copy link
Contributor

Thanks! I tried this against mainnet RPC for one mainnet baker as a dry run and your branch and ithaca2 gave me the same calculation csv file, so I'm merging into ithaca2.

@jdsika we should really look into merging ithaca2 into master.

@nicolasochem nicolasochem merged commit e4f98de into tezos-reward-distributor-organization:ithaca2 Apr 30, 2022
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