Skip to content

Block-stm initial commit#7812

Closed
cffls wants to merge 1 commit intoerigontech:mainfrom
cffls:devel
Closed

Block-stm initial commit#7812
cffls wants to merge 1 commit intoerigontech:mainfrom
cffls:devel

Conversation

@cffls
Copy link
Copy Markdown

@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.

Comment thread core/blockstm/mvhashmap.go
accessList: newAccessList(),
transientStorage: newTransientStorage(),
balanceInc: map[libcommon.Address]*BalanceIncrease{},
readMap: make(map[blockstm.Key]blockstm.ReadDescriptor),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@github-actions
Copy link
Copy Markdown

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 priority:low labels Apr 27, 2024
@yperbasis yperbasis changed the base branch from release/2.60 to main May 1, 2024 07:13
@mh0lt
Copy link
Copy Markdown
Contributor

mh0lt commented Apr 25, 2025

This code has now been replaced by the full e3 STM implementation in this branch: https://github.com/erigontech/erigon/tree/async_tx

@mh0lt mh0lt closed this Apr 25, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants