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

RSKIP 351 + RSKIP 144 #1930

Merged
merged 112 commits into from
Oct 9, 2024
Merged

RSKIP 351 + RSKIP 144 #1930

merged 112 commits into from
Oct 9, 2024

Conversation

ilanolkies
Copy link
Contributor

@ilanolkies ilanolkies commented Nov 18, 2022

Merge from #1793 into #1925

fed:rskip351+rskip144

ilanolkies and others added 22 commits October 24, 2022 21:09
Versioned header + block header compression + body response message with header extension
* Added transaction execution lists edges to block header

* Added parallel transaction execution (#1788)

* Validates transaction execution lists edges (#1789)
Instead of paying to the REMASC contract…every transaction, the fees are accumulated into a variable and once all of the transactions are processed, the fees are added to the Remasc's balance in the MutableRepository. If the rREMASCFee is greater than 0 the payment is made. Some tests had to be changed since they replicate the behavior of the block executor and the REMASC payment is actually made in the block executor so the tests were modified as well
* Added the execution plan for the transaction to the block header as a transactionEdgeList.

* Added ParallelizeTransactionHandler that builds the different buckets that are going to be executed by different threads. If the sequential bucket doesn't have enough gas for the new transaction, the transaction isn't added to the block. In addition, once all the transactions are processed, the order of the transactions in the buckets is added to the receipt. The REMASC transaction is always added to the SequentialBucket. When a transaction is properly added to a bucket, it returns the gas used in that bucket.

* Added a tracker to the MutableRepository (MR). If the MR is used for any reason but builds the block, the tracker used is a DummyTracker one.

* Review processed

* Handler's been refactorized (#1760)

* Added tests.

* Research/parallel-tx/splitting executions (#1799)

* changed method names, deleted executeInternal from blockExecutor, and changed execute for executeParallel in some places. fixed BlockExecutorTest since from now on when the block is executed with executeAndFill and its blockNumber is over the rskip144 then the transactionEdgeList is built by the miner

* Three changes so test pass (i) Changed the block hash in Web3ImplLogsTest due to the new field in the header for txEdges, (ii) Many tests used a really high gas, then we decided not to split the gas limit by two for parallel and sequential bucket, and (iii) addRemascFee wasn't present in the oldSequentialExecute and now is added.
* Added thread logic in the Tracker so it controls whether there is a key collision between threads

* Clear tracker between parallel and sequential execution within the parallel block execution

* Tracker is now atomic

* Added tests to test for race conditions

* Tracker returns a copy of the maps.
* store and return a copy of txEdges

* merged two ifs in the BlockHeaderBuilder

* DummyTracker updated so it returns a copy of the maps

* Unused hashmap import deleted from ProgramTraceProcessor

* BlockResult returns and stores a copy of txEdges

* big refactor in BlockExecutor

* Refactor ParallelizeTransactionHandler

* renaming Bucket to Sublist

* renaming txExecutionListsEdges to txExecutionSublistEdges

* simplification of Handler's code

* InterruptedException solved properly in the BlockExecutor
* Avoid tracking write for add balance 0

* Avoid tracking when writing the same value

* Rename assertion

* Remove condition for add balance zero

It is considered in "write the same value"

* Revert breaks
* Remove same written value check

Ignored repository tracking tests

* Add tests for addBalance

* Avoid writing on addBalance(0)
* Refactor repeated code

* Refactor repeated edges mocking

* Modify test for too many edges - it was also hitting out of bounds

* Refactor out of bounds validation

If edges are in order, last edge decides if any was out of bounds

* Rename test

* Add case where first edge is zero

First changed to prev = -1, then added test that failed, then set back prev = 0

* Refactor order verification

* Research/refactoring code (#1817)

* store and return a copy of txEdges

* merged two ifs in the BlockHeaderBuilder

* DummyTracker updated so it returns a copy of the maps

* Unused hashmap import deleted from ProgramTraceProcessor

* BlockResult returns and stores a copy of txEdges

* big refactor in BlockExecutor

* Refactor ParallelizeTransactionHandler

* renaming Bucket to Sublist

* renaming txExecutionListsEdges to txExecutionSublistEdges

* simplification of Handler's code

* InterruptedException solved properly in the BlockExecutor

* Research/parallel-tx/optimize writes (#1811)

* Avoid tracking write for add balance 0

* Avoid tracking when writing the same value

* Rename assertion

* Remove condition for add balance zero

It is considered in "write the same value"

* Revert breaks

* Add test refactor back

* Make remasc transaction not be in a parallelized sublist

* Research/parallel-tx/Fix isRemascTransaction validation and pass correct index (#1822)

* Fix isRemascTransaction validation and pass correct index

* Remove -1

* Rename local data

* Add tests for isRemascTransaction

* Add tests for remasc transaction

* Fix txindex

Added test for block with rejected tx

* Add missing txindex++

* Fix merge error

Co-authored-by: julianlen <[email protected]>
* B1. Confusing Naming of conflict sets - Solved
* B3. Incorrect use of LongAccumulator
* B4. Truncated BigInteger Pays Incorrect Fees
* B5. Setup of new Precompiles is not correctly tracked
* B7. Determinism even on conflict (#1873)
* 2X performance improvement, and better tests (#1884)

Co-authored-by: Sergio Demian Lerner <[email protected]>
* it checks if remasc is enabled before performing the payment to the remasc address

* modified remasc payment so it is paid just before the remasc transaction is processed
@ilanolkies ilanolkies requested a review from a team as a code owner November 18, 2022 19:11
@ilanolkies ilanolkies force-pushed the rskip351+rskip144 branch 3 times, most recently from fb96716 to 06d0b0e Compare November 23, 2022 19:53
@Vovchyk
Copy link
Contributor

Vovchyk commented Jul 4, 2024

pipeline:run

@Vovchyk
Copy link
Contributor

Vovchyk commented Jul 4, 2024

pipeline:run

Copy link

sonarcloud bot commented Jul 18, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 New Blocker Issues (required ≤ 0)
2 New Critical Issues (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@Vovchyk
Copy link
Contributor

Vovchyk commented Jul 18, 2024

pipeline:run

@Vovchyk
Copy link
Contributor

Vovchyk commented Sep 4, 2024

pipeline:run

@Vovchyk
Copy link
Contributor

Vovchyk commented Sep 5, 2024

pipeline:run

@Vovchyk Vovchyk marked this pull request as ready for review September 5, 2024 15:23
@Vovchyk Vovchyk requested a review from a team as a code owner September 5, 2024 15:23
Copy link

sonarcloud bot commented Oct 8, 2024

Copy link
Contributor

@nagarev nagarev left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@Vovchyk Vovchyk merged commit e8fae59 into master Oct 9, 2024
11 checks passed
@Vovchyk Vovchyk deleted the rskip351+rskip144 branch October 9, 2024 09:04
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.

9 participants