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

[stateless_validation] Handle production of state witness for first chunk after genesis #10502

Closed
shreyan-gupta opened this issue Jan 25, 2024 · 0 comments · Fixed by #10633
Closed
Assignees
Labels
A-stateless-validation Area: stateless validation

Comments

@shreyan-gupta
Copy link
Contributor

@Longarithm has more context on this problem.

We are currently unable to handle production of the state witness for the first chunk after genesis as it's not possible to run the genesis chunk in runtime. For now we have just hacked up a solution to send an empty state witness and the validators can ignore this and directly send the endorsement.

Note: This is only a problem for starting a new blockchain, and does not affect mainnet, nevertheless should be properly addressed.

github-merge-queue bot pushed a commit that referenced this issue Jan 26, 2024
…r genesis (#10503)

This is mainly to solve issues related to testing where we were
initially not getting the chunk endorsements.

I've created an issue for this here:
#10502

Fixes issue in PR #10487
@pugachAG pugachAG self-assigned this Feb 20, 2024
@pugachAG pugachAG added the A-stateless-validation Area: stateless validation label Feb 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 23, 2024
This PR removes "approve anything" shortcut when previous chunk is part
of genesis. The only difference in case of genesis is that we don't want
to execute main state transition and instead just check that post state
root matches genesis state root for that shard.

This also exposed some issue I had to fix to make tests work:
* `MockEpochManager::get_epoch_chunk_producers` returns empty Vec which
results in `Chain:: should_produce_state_witness_for_this_or_next_epoch`
returning `false`. Fixed by adding `is_chunk_producer_for_epoch` as part
of `EpochManagerAdapter` so `MockEpochManager` can override it.
* `test_chunk_state_witness_bad_shard_id` test started failing: this
actually uncovered a real issue which could result in crashing chunk
validator when state witness contains invalid shard id, fixed in
c5b2c5e

Closes #10502.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants