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 code implementation #1329

Closed
xuyi33333 opened this issue Sep 13, 2024 · 6 comments
Closed

Block-STM code implementation #1329

xuyi33333 opened this issue Sep 13, 2024 · 6 comments
Labels

Comments

@xuyi33333
Copy link

func (task *ExecutionTask) Execute(mvh *blockstm.MVHashMap, incarnation int) (err error) {
task.statedb = task.cleanStateDB.Copy()
task.statedb.SetTxContext(task.tx.Hash(), task.index)
....
}

I would like to understand why each execution requires "task.statedb = task.cleanStateDB.Copy()." Is it to ensure determinism?"

@xuyi33333
Copy link
Author

I believe that if the statedb is large, such copying could lead to significant performance overhead. Can parallel execution really compensate for this overhead and surpass serial execution? Also, I don't quite understand why copying is necessary in this case. I look forward to your response.

@xuyi33333
Copy link
Author

xuyi33333 commented Sep 13, 2024

	pe.stats[res.ver.TxnIndex] = ExecutionStat{
					TxIdx:       res.ver.TxnIndex,
					Incarnation: res.ver.Incarnation,
					Start:       uint64(start),
					End:         uint64(end),
					Worker:      procNum,
 }.  

I believe that the time calculated by end - start includes the time spent on copying, and not just the actual execution time. Is that correct?

@cffls
Copy link
Contributor

cffls commented Sep 14, 2024

I would like to understand why each execution requires "task.statedb = task.cleanStateDB.Copy()." Is it to ensure determinism?"

This is to prevent a task from modifying the state from another.

I believe that if the statedb is large, such copying could lead to significant performance overhead.

Copying happens in memory, it is insignificant compared to other operations, such as loading data from database.

start includes the time spent on copying, and not just the actual execution time.

Yes, it includes the time of copying.

@xuyi33333
Copy link
Author

I am currently trying to port the block-stm implementation to the EVM. After syncing Ethereum's data and executing its transactions, I noticed that parallel execution is not faster than serial execution. Could you please share some insights into potential reasons for this based on the implementation? Thank you very much!

Copy link

github-actions bot commented Oct 1, 2024

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Oct 1, 2024
Copy link

This issue was closed because it has been stalled for 28 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants