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

Block-stm initial commit #7812

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Block-stm initial commit #7812

wants to merge 1 commit into from

Conversation

cffls
Copy link
Collaborator

@cffls cffls commented Jun 27, 2023

This PR enables parallel execution of transactions when validating blocks. A similar PR has been merged to bor.

The major change of existing component that needs attention is in "intra_block_state.go", where a multi-version hashmap is added between EVM and database.

@@ -103,6 +111,253 @@ func New(stateReader StateReader) *IntraBlockState {
accessList: newAccessList(),
transientStorage: newTransientStorage(),
balanceInc: map[libcommon.Address]*BalanceIncrease{},
readMap: make(map[blockstm.Key]blockstm.ReadDescriptor),
Copy link
Collaborator

@AskAlexSharov AskAlexSharov Jun 28, 2023

Choose a reason for hiding this comment

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

please take a look if you can use existing methods: ibs.SoftFinalise(), ibs.MakeWriteSet, txTask.ReadLists = rw.stateReader.ReadSet(), txTask.WriteLists = rw.bufferedWriter.WriteSet().
you can find them in:
cmd/state/exec3/state.go:RunTxTask

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the pointers. Will look into them.

@AlexeyAkhunov
Copy link
Contributor

This is an interesting idea, and somewhat (or largely) overlaps with our own experiments on the parallel execution. And I am aware of block-stm ideas from the Polygon team.
At this point, I would rather not attempt on plugging this in, for two main reasons:

  1. Parts of the code it is touching (and therefore would need extensive correctness and performance testing) are the same as we need to modify for Erigon3 project - and this extra disturbance and will potentially delay erigon3, which is critical for us.
  2. We are considering replacing EVM implementation (including intra_block_state.go) with the code from Silkworm (evmone + some code around it in C++), so trying to port block-stm would also add to that effort.

@cffls
Copy link
Collaborator Author

cffls commented Jul 11, 2023

This is an interesting idea, and somewhat (or largely) overlaps with our own experiments on the parallel execution. And I am aware of block-stm ideas from the Polygon team. At this point, I would rather not attempt on plugging this in, for two main reasons:

  1. Parts of the code it is touching (and therefore would need extensive correctness and performance testing) are the same as we need to modify for Erigon3 project - and this extra disturbance and will potentially delay erigon3, which is critical for us.
  2. We are considering replacing EVM implementation (including intra_block_state.go) with the code from Silkworm (evmone + some code around it in C++), so trying to port block-stm would also add to that effort.

Thanks @AlexeyAkhunov for the inputs. Agreed that it might be too early to plug this in. Do you think we should wait for both Erigon3 and EVM implementation replacement to complete before working on this PR, or just the completion of Erigon3?

@github-actions
Copy link

This PR is stale because it has been open for 40 days with no activity.

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

This PR is stale because it has been open for 40 days with no activity.

@github-actions github-actions bot added the Stale label Oct 3, 2023
@yperbasis yperbasis removed the Stale label Nov 13, 2023
mh0lt pushed a commit that referenced this pull request Nov 24, 2023
…lock-STM (#8037)

This PR adds support to store the transaction dependency (generated by
the block producer) in the block header for bor. This transaction
dependency will then be used by the parallel processor
([Block-STM](#7812)).

I have created another
[PR](ledgerwatch/erigon-lib#1064) in the
erigon-lib repo which adds the `IsParallelUniverse()` function.
@mh0lt mh0lt added do-not-merge PR that is in a merge-able state but is waiting for something else to take place before merging imp3 Low importance labels Apr 27, 2024
@yperbasis yperbasis changed the base branch from release/2.60 to main May 1, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge PR that is in a merge-able state but is waiting for something else to take place before merging imp3 Low importance polygon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants