Commit graph

2566 commits

Author SHA1 Message Date
Arpit Temani
7253babddc revert pruning hotfix 2023-12-27 16:42:06 +05:30
Arpit Temani
532ebd41e9 debug testing 2023-12-18 15:40:54 +05:30
Pratik Patil
e3192cae8b
hot fix: block stm ParallelSpeculativeProcesses flag 2023-11-24 12:50:04 +05:30
Arpit Temani
53c7d9b228 remove unnecessary lines 2023-11-24 11:35:13 +05:30
Arpit Temani
9c1308818c make blobgas nil 2023-11-10 14:29:27 +05:30
Arpit Temani
073bb183da make blobgas nil 2023-11-10 14:22:14 +05:30
Arpit Temani
bee537ab98 fix lint 2023-11-09 21:19:27 +05:30
Arpit Temani
cee2c221b2 disbale 4844 2023-11-09 20:43:18 +05:30
Pratik Patil
aa604a6744
added conditional transaction filtering in legacypool 2023-11-08 16:23:43 +05:30
Arpit Temani
1483c960ed merge develop 2023-11-03 10:10:02 +05:30
Arpit Temani
bc338be57b
Merge pull request #1068 from maticnetwork/v1.1.0-beta-candidate
Merge V1.1.0 beta candidate to 'develop'
2023-11-02 16:47:53 +05:30
Shivam Sharma
953039d1c0 rm : prevrandao 2023-11-01 00:44:16 +05:30
SHIVAM SHARMA
ab42a16a1b
fix : typo in (tx *DynamicFeeTx) gasPriceU256() (#1064) 2023-10-30 13:23:34 +05:30
Anshal Shukla
9f4457958d bor: make withdrawals nil 2023-10-20 15:05:41 +05:30
Paul O'Leary
a9c57370cd
Change legacy rando geth fork choice to be deterministic (#871)
* Change legacy rando geth fork choice to be deterministic, based on block hash.

* core: add forkchoice tests

* fix

---------

Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
2023-10-19 12:56:30 +05:30
Arpit Temani
1aa033520c fix tests 2023-10-17 00:52:04 +05:30
Arpit Temani
01a4c0d026 fix linters 2023-10-16 23:55:16 +05:30
Arpit Temani
109a0a19a6 enable hf in tests 2023-10-16 23:45:55 +05:30
Arpit Temani
48f6200449 merge shanghai tests 2023-10-16 23:23:13 +05:30
Shivam Sharma
1fc6354ab1 clean : shanghai changes 2023-10-06 12:06:46 +05:30
Shivam Sharma
558bb5433f fix : config and forkId tests 2023-10-05 14:39:43 +05:30
Shivam Sharma
2b1bd0997b Merge branch 'develop' into shivam/POS-1733 2023-10-05 12:14:31 +05:30
Arpit Temani
08b4937cb6 fix lint 2023-09-23 16:26:23 +05:30
Arpit Temani
c763560f88 fix testcases 2023-09-23 15:18:40 +05:30
Arpit Temani
7f727cb65d skip tests 2023-09-22 17:03:17 +05:30
Arpit Temani
11eb53be2b fix tests 2023-09-22 15:03:24 +05:30
Arpit Temani
4e3bcbc90d fix testcases 2023-09-21 21:07:50 +05:30
Arpit Temani
cc2c27dbd3 fix linters 2023-09-21 10:50:01 +05:30
Arpit Temani
735ae740fa fix test-integration 2023-09-20 22:10:54 +05:30
Arpit Temani
046030df1f merge latest develop 2023-09-20 21:56:08 +05:30
Arpit Temani
8653c83007 fix test-integration 2023-09-20 21:44:07 +05:30
Arpit Temani
3626e5f7e4 fix testcase syntax 2023-09-20 15:57:37 +05:30
Pratik Patil
8f6bb5c248
added RLock on pool.pendingMu in validateTxBasics() (#1001) 2023-09-14 09:48:30 +05:30
Arpit Temani
feea10a820 fix todos 2023-09-13 14:26:54 +05:30
Pratik Patil
67fc4d87fb
Added a new RPC endpoint (bor_sendRawTransactionConditional) to support EIP-4337 Bundled Transactions (#945)
* added new api to support conditional transactions (EIP-4337) (#700)

* Refactored the code and updated the miner to check for the validity of options (#793)

* refactored the code and updated the miner to check for the validity of options

* added new errors -32003 and -32005

* added unit tests

* addressed comments

* Aa 4337 update generics (#799)

* poc

* minor bug fix

* use common.Hash

* updated UnmarshalJSON function (reference - tynes)

* fix

* done

* linters

* with test

* undo some unintentional changes

---------

Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>

* handelling the block range and timestamp range, also made timestamp a pointer

---------

Co-authored-by: Evgeny Danilenko <6655321@bk.ru>

* Added filtering of conditional transactions in txpool (#920)

* added filtering of conditional transactions in txpool

* minor fix in ValidateKnownAccounts

* bug fix

* Supporting nil knownAccounts

* lints

* bundled transactions are not announced/broadcasted to the peers

* fixed after upstream merge

* few fixes

* sentry reject conditional transaction

* Changed the namespace of conditional transaction API from `eth` to `bor` (#985)

* added conditional transaction to bor namespace

* test comit

* test comit

* added conditional transaction

* namespapce changed to bor

* cleanup

* cleanup

* addressed comments

* reverted changes in ValidateKnownAccounts

* addressed comments and removed unwanted code

* addressed comments

* bug fix

* lint

* removed licence from core/types/transaction_conditional_test.go

---------

Co-authored-by: Evgeny Danilenko <6655321@bk.ru>
2023-09-13 08:28:00 +05:30
Pratik Patil
3442c0336d
Merge pull request #998 from maticnetwork/v1.0.0-beta-candidate
V1.0.0 beta candidate
2023-09-12 21:41:19 +05:30
rroblak
ebc7dc231a
Add CLI flags to config LevelDB table/total sizes (#981)
* Add CLI flags to config LevelDB table/total sizes

I wired up CLI flags to allow configuring LevelDB table and total sizes:
  - `--leveldb.compaction.table.size`, LevelDB SSTable file size factor in MiB (default: 2)
  - `--leveldb.compaction.table.multiplier`, multiplier on LevelDB SSTable file size (default: 1)
  - `--leveldb.compaction.total.size`, total size factor in MiB of LevelDB levels (default: 10)
  - `--leveldb.compaction.total.multiplier`, multiplier on LevelDB total level size (default: 10)

N.B. that the default values for these configs are exactly the same as
before this changset and so Bor behavior should not change unless these
flags are deliberately overridden. Bor/Geth inherited the default values
from [the `goleveldb`
defaults](126854af5e/leveldb/opt/options.go).

We (Alchemy) found it necessary to override these configs as follows to
keep Bor archive nodes tracking the canonical chain:
  - `--leveldb.compaction.table.size=4`
  - `--leveldb.compaction.total.size=20`

These overrides double the size of LevelDB SSTable files (2 MiB -> 4
MiB) and also the total amount of data in each level (100 MiB -> 200
MiB, 1,000 MiB -> 2,000 MiB, etc.). The idea is to have LevelDB read and
write data in larger chunks while keeping the proportional frequency of
compaction operations the same as in the original defaults defined by
Dean and Ghemawat.

Without these overrides we found that our archive nodes would tend to
fall into a "LevelDB compaction loop of death" where the incoming stream
of blockchain data could not be flowed into LevelDB's structure quickly
enough, resulting in the node blocking writes for long periods of time
while LevelDB's single-threaded compaction organized the data.  Over
time the nodes would fall farther and farther behind the canonical chain
head, metaphorically dying a slow node's death.

These configs can be changed on existing node databases (resyncing is
not necessary). LevelDB appears to work correctly with SSTable files of
different sizes. Note that the database does not undergo any sort of
migration when changing these configs. Only newly-written files (due to
new data or compaction) are affected by these configs.

* Update docs

* Adjust line spacing for linter

* Replace map with `ExtraDBConfig`

* Rename `LevelDbConfig` to `ExtraDBConfig`

* Regenerate docs
2023-09-12 12:09:26 +02:00
marcello33
19826950a8 core/types: fix receipt EffectiveGasPrice unmarshaling 2023-09-08 17:45:36 +02:00
Arpit Temani
986486bb37 merge develop 2023-09-04 14:14:19 +05:30
Arpit Temani
1316786d2d commented lint 2023-09-04 14:01:45 +05:30
Arpit Temani
b32521d456 version change for milestones 2023-08-29 17:50:05 +05:30
Arpit Temani
f10517918e Merge tag 'v0.5.0-beta-6' of github.com:maticnetwork/bor into arpit/merge-latest-branch 2023-08-29 17:44:54 +05:30
Arpit Temani
b48b89f852
all: implement milestones (#961)
* Milestone Implementation

* Merge branch 'POS-347' into reciept-e2e-test

* Changes for testing, will be removed after testing

* Debugged the error

* Just for testing purpose

* refactor debug api methods, rename whitelist -> checkpoint

* remove first iteration based vars

* fix linters

* Rewind Changes

* Error changes

* RewindBack function in bor_checkpoint_verifier

* Testcases

* Added the fetch test for milestone and checkpoint

* Debugged the lint changes

* Debugged the lint changes

* Debugged the lint changes

* Debugged the lint changes

* Improved the error in Miner test file

* Improved the error of pointing to the wrong function

* Locking the sprint after the vote has been made on it.

* Adding more logs for testing

* Adding more logs for testing

* Adding more logs for testing

* Implemented the NoAckMilestone fetching mechanism

* Testcases for milestone implementation

* Testing code  for fetchNoAckMilestone and fetchLastNoAckMilestone

* Testing changes

* refactor else-if

* Corrected the number of params in bor_ext.go

* Dummy API for testing

* Defined the GetVoteOnRootHash in interface

* Defined the GetVoteOnRootHash in interface

* Made changes in the web3ext file

* Added the GetVoteOnRootHash in PublicBlockChain API

* Added the GetVoteOnRootHash in filterBackend

* Added the log of Root and RooHash

* Removed the 0x from rootHash

* Just for testing purpose

* "GetVoteOnRootHash" mock implementation

* bor_test.go

* Added the test for milestone implementation

* Added service for fetching milestone by ID

* Improved the comments

* Removed the duplicate code

* use setter for borVerifier

* use setter for borVerifier

* refactor handleNoAckMilestone

* remove code repetition with retry function

* Converged the repetitive code

* after CR

* persistence

* persistence implementation

* feature flag

* Persistence Changes

* cr

* initial

* fix

* fix

* Whitelist Flag

* 1 Add:Included the milestone flag  2.Add:Hardlimit the rewind to maximum of 255 blocks

* Chg:Updated go.mod file

* Remove:Dubai Hardfork code

* Add:checked errors for call functions to the Db, Rmv: Remote Header variable from the IsValidPeer() function

* Fix:Linting issues'

* Add:MilestoneGRPC functions

* Fix:Lint issues

* Fix:Lint issues

* Fix: TestFetchMilestoneFromMockHeimdall

* Fix:Integrations tests

* Add:Test for sprint length and milestone changes

* Add:Functionality to fetch the finalized block

* Chg:Changed default val of TriesInmemory to 1024

* fix:Some functions of heimdallGRPC client

* Restored the GRPC functionality, was commented out for  developing purpose

* Fix:Bor_checkpoint_Verfier function

* Test:Added the chain Rewinding test

* Test:Added the Sprint Length + Milestone merge test

* Add:Implemented the future milestone

* Add:Future milestone changes

* Add:Future milestone changes

* Chg: Voting on endBlockHash rather than rootHash

* Chg: Changed the logic of future milestone from rootHash checking to endBlockHash checking

* Fix:Using endBockHash while verifying the incoming milestone

* Chg:Variable names for better readiblity

* Fix:Testing changes

* Add:metrics for milestone implementation

* Add:Metrics for milestone implementatian

* Fix:Order of statements in a function for better optimization

* Chg:Removed unrequired file

* Fix:new variable intialization

* Add:Comment to increase readiblity

* Fix:Logs

* Chg:Name of GetVoteOnRootHash to GetVoteOnHash

* Fix:Linting issues

* Fixed linting issues

* Rmv: Unnecessary logs and Add:Skip test for long tests

* Fix:Checking current chain with whitelisted milestone or checkpoint in Finalized block function

* Fix:Test

* Fix:Whitelisting of Milestone and Checkpoint process

* Fix: Milestone JSON structure

* Chg:Testcases changes

* Fix:Change from VoteOnRootHash to VoteOnHash

* Fix:Variable name fix

* Fix:Finalized API

* internal/jsre/deps: update web3.js bundle

* Fix:milestone verifier

* Chg:Handling the long future chain import issue

* Fix:Lint issues

* Fix:TestLowDiffLongChain and TestPrunedImportSide tests, used hardcoded value 128 instead of DefaultTriesInMemory value

* Chg:Testcode for producing metrics

* Chg:Milestong polling value to 32 secs

* Add:Testcases

* Add:Implemented the check to fetch the milestoneId from heimdall before locking the fork

* Added GRPC method for FetchMilestoneID

* Fix:lint issue

* Fix:lint issue

* Skiped out the tests which were mainly used to produce the supporting data

* remove vcs build when running snyk

* Add:Improved the logs and comments

* fix linters

* Skipped some test as they are panic due to timeout issue in github

* Chg:Variable name LockerSprintNumber to LockedMilestoneNumber for better readablity and clarity

* Chg:Conflicting variable names in milestone test file

* Chg:Conflicting function names in milestone test file

* fix : minor fix in TestInsertingSpanSizeBlocks

* Fix:Mocking issue in TestInsertingSpanSizeBlocks

* Fix:GRPC Polyproto Version

* eth/downloader: skip peer drop due to whitelisting err

* eth, tests/bor: bug fixes and minor refactor

* Add:Implemented the milestone related functions in the HeimdallApp

* Fix:Lint Errors & Remove:Redundant Code

* Fix:Testing Errors

* Fix:Bor integeration tests

* Fix:Test errors

* update heimdall client mock files

* remove unused arguments

* remove redundant code

* Chg:Changed the milestone polling intervals

* Add: added block finality from whitelisted checkpoint

* skip future chain validation

* Add:confirmation check of 16 blocks over the end block while voting for the milestone in GetVoteHash() function

* Chg:Included endBlockNum in UnlockMutex function

* Add:Property based test for milestone

* Fix:Opening the lock while processing future milestone

* Add:Property based test for futureMilestone

* Defined the value of TempTriesInMemory

* Fixed the finalized api

* Fixed lint issues

* eth: add logs while fetching and rewinding

* fix linters: use default returns instead of recursive calls

* Fix:Milestone intergration test

* Add:GetVoteHash fn in mock backend

* tests/bor: fix mock span

* tests/bor: remove t.Parallel()

* use bor namespace in ethclient, fix mock function

---------

Co-authored-by: Vaibhav Jindal <vaibhavjindal29@gmail.com>
Co-authored-by: VaibhavJindal <74560896+VAIBHAVJINDAL3012@users.noreply.github.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Evgeny Danienko <6655321@bk.ru>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Anshal Shukla <shukla.anshal85@gmail.com>
2023-08-28 18:42:21 +05:30
Manav Darji
9eb9bfe181 core/txpool: convert lock acquire log to debug 2023-08-24 11:42:05 +05:30
Arpit Temani
d3c5bc9b45 fix build 2023-08-21 17:48:09 +05:30
Shivam Sharma
56ca065961 chg : shanghaiTime to shanghaiBlock 2023-08-18 17:05:13 +05:30
Arpit Temani
b343cffdb4 merge geth v1.12.2 into develop 2023-08-18 14:05:34 +05:30
Péter Szilágyi
811a674059 all: update golang/x/ext and fix slice sorting fallout (#27909)
The Go authors updated golang/x/ext to change the function signature of the slices sort method. 
It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just 
picked a new version that some other dep depends on, causing our code to fail building.

This PR updates the dep on our code too and does all the refactorings to follow upstream...
2023-08-12 00:19:12 +02:00
imulmat4
55863ce0d8 core/txpool/blobpool: fix metrics name for prometheus export (#27901) 2023-08-12 00:18:16 +02:00
Guillaume Ballet
67979022aa
core/state: move UpdateContractCode before the trie hash is computed (#27853)
Context: The UpdateContractCode method was introduced for the state storage commitment
schemes that include the whole code for their commitment computation. It must therefore be called
before the root hash is computed at the end of IntermediateRoot.

This should have no impact on the MPT since, in this context, the method is a no-op.
2023-08-09 18:02:45 +02:00