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

feat(snap): adjust snap config #2797

Open
wants to merge 130 commits into
base: snap-v4-final
Choose a base branch
from

Conversation

Vovchyk
Copy link
Contributor

@Vovchyk Vovchyk commented Oct 10, 2024

Description

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

ilanolkies and others added 30 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
* The checking for the parameter value was wrong in the addBalance method, it fixes it

* Add tests back

Co-authored-by: Ilan <[email protected]>
Vovchyk and others added 27 commits September 5, 2024 13:55
…ress-sonar

fix(pte): suppress sonar warnings
…44-merge

master -> rskip351+rskip144 merge
build: run rit check overnight; allow plus symbol in branch names
perf: improve decoding in CallTransaction
Update test in BitcoinUtilsTest to be deterministic
Fix Type Safety Issues in BridgeMethodExecutorTyped Functions
@Vovchyk Vovchyk requested review from a team as code owners October 10, 2024 12:25
Copy link

sonarcloud bot commented Oct 10, 2024

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.

10 participants