onflow / flow-go

A fast, secure, and developer-friendly blockchain built to support the next generation of games, apps, and the digital assets that power them.
GNU Affero General Public License v3.0
534 stars 179 forks source link

Add offchain block context creation method #6751

Closed janezpodhostnik closed 3 days ago

janezpodhostnik commented 4 days ago

This adds a way to create block context used for re-execution so that the block context contains historically correct data.

This addresses the Block Hash list issue and the coinbase issue. more details in the comments of the code.

codecov-commenter commented 4 days ago

Codecov Report

Attention: Patch coverage is 30.00000% with 42 lines in your changes missing coverage. Please review.

Project coverage is 43.23%. Comparing base (a3676ba) to head (cadbde9).

Files with missing lines Patch % Lines
fvm/evm/offchain/blocks/block_context.go 32.72% 37 Missing :warning:
fvm/evm/offchain/blocks/blocks.go 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6751 +/- ## ========================================== + Coverage 41.23% 43.23% +1.99% ========================================== Files 2060 1586 -474 Lines 182635 146021 -36614 ========================================== - Hits 75316 63128 -12188 + Misses 101011 77665 -23346 + Partials 6308 5228 -1080 ``` | [Flag](https://app.codecov.io/gh/onflow/flow-go/pull/6751/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/onflow/flow-go/pull/6751/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow) | `43.23% <30.00%> (+1.99%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: