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

Fixed a small bug in the Report function #530

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

pratikspatil024
Copy link
Member

We only used to sort the roots, we should also modify the rootIds in the same order.

@@ -80,7 +100,7 @@ func (d DAG) Report(out func(string)) {
rootIds = append(rootIds, k)
}

sort.Ints(roots)
roots, rootIds = bubbleSort(roots, rootIds)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is the best way to sort this. Can we create a map (roots -> rootIds), sort roots, and re-create a sorted rootId slace based on the sorted roots and the map?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes sure, will do this.

@pratikspatil024 pratikspatil024 force-pushed the block-stm-fix-bug branch 2 times, most recently from 284f93f to 530e723 Compare September 27, 2022 03:00
@@ -74,13 +74,19 @@ func BuildDAG(deps TxnInputOutput) (d DAG) {
func (d DAG) Report(out func(string)) {
roots := make([]int, 0)
rootIds := make([]string, 0)
rootIdMap := make(map[int]string, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe consider preallocating the map with the size of len(d.GetRoots())?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@pratikspatil024 pratikspatil024 merged commit 866a2b7 into block-stm Sep 27, 2022
@pratikspatil024 pratikspatil024 deleted the block-stm-fix-bug branch September 27, 2022 07:01
cffls pushed a commit that referenced this pull request Sep 29, 2022
pratikspatil024 added a commit that referenced this pull request Oct 7, 2022
* Create MVHashMap and use it StateDB

* Parallel state processor

* Move fee burning and tipping out of state transition to reduce read/write dependencies between transactions

* Re-execute parallel tasks when there is a read in coinbase or burn address

* Block-stm optimization

Added tests for executor and two major improvements:

1. Add a dependency map during execution. This will prevent aborted tasks from being sent for execution immedaitely after failure.
2. Change the key of MVHashMap from string to a byte array. This will reduce time to convert byte slices to strings.

* Remove cache from executor test

* added mvhashmap unit tests (with  as key)

* Shard mvhashmap to reduce the time spent in global mutex

* Skip applying intermediate states

* Dependency improvement

* added test for status

* Create MVHashMap and use it StateDB

* Parallel state processor

* Move fee burning and tipping out of state transition to reduce read/write dependencies between transactions

* Re-execute parallel tasks when there is a read in coinbase or burn address

* Txn prioritizer implemented using mutex map (#487)

* basic txn prioritizer implemented using mutex map

* Re-execute parallel tasks when there is a read in coinbase or burn address

* Re-execute parallel tasks when there is a read in coinbase or burn address

* using *sync.RWMutex{} in mutexMap

Co-authored-by: Jerry <jerrycgh@gmail.com>

* added getReadMap and getWriteMap (#473)

* Block-stm optimization

Added tests for executor and some improvements:

1. Add a dependency map during execution. This will prevent aborted tasks from being sent for execution immedaitely after failure.
2. Change the key of MVHashMap from string to a byte array. This will reduce time to convert byte slices to strings.
3. Use sync.Map to reduce the time spent in global mutex.
4. Skip applying intermediate states.
5. Estimate dependency when an execution fails without dependency information.
6. Divide execution task queue into two separate queues. One for relatively certain transactions, and the other for speculative future transactions.
7. Setting dependencies of Txs coming from the same sender before starting parallel execution.
8. Process results in their semantic order (transaction index) instead of the order when they arrive. Replace result channel with a priority queue.

* Do not write entire objects directly when applying write set in blockstm

* fixed a small bug in the Report function (#530)

* linters

Co-authored-by: Jerry <jerrycgh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants