Commit Graph

468 Commits

Author SHA1 Message Date
Alex Sharov
5be29adf1a
Grpc err utils (#334)
* save

* save
2022-02-18 09:40:11 +07:00
Alex Sharov
1f5a1ab9cd
fuzz cases (#328) 2022-02-14 11:53:20 +07:00
Alex Sharov
57d026dcca
grpc: disabled server txpool (#314)
* grpc disabled server txpool

* grpc disabled server txpool
2022-02-12 12:24:17 +07:00
ledgerwatch
11615db276
Fix memory leak in txpool (#298)
* Fix memory leak in txpool

* Cannot delete during iteration

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-02-03 17:52:20 +00:00
Alex Sharov
ec354d1615
Fuzz fixes (#295)
* fuzz tests fixes

* fuzz tests fixes
2022-02-02 09:18:04 +00:00
Alex Sharov
a53f232322
pool: fix race in async broadcast (#294)
* pool: better async broadcast

* save

* save
2022-02-02 14:49:26 +07:00
Alex Sharov
74d49a9de1
non blocking broadcast of new txs (#292) 2022-02-01 12:16:43 +00:00
ledgerwatch
1d4022960a
Fix RLP inconsistency in txpool (#280)
* Fix RLP inconsistency in txpool

* Add debug

* hasEnvelope argument when parsing transaction

* Handle incorrect packets without panic

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-01-26 16:09:02 +00:00
ledgerwatch
df95313a31
Add blockGasLimit to the state stream (#261)
* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit eff9f8f

git-subtree-dir: interfaces
git-subtree-split: eff9f8f7273dda7c78575f2474e3103da61825db

* Add blockGasLimit to the state stream

* Pass blockGasLimit into txpool

* Add NotTooMuchGas bit, refactored promote

* Replace effectiveTip with minTip in the queues and slices

* Fix lint

* Refactor

* Improve terminology of ordering function

* Optimise baseFee change

* cleanup

* Safe operations

* Fix UnsafeAdd

* also print pendingBaseFee

* trace txpool_content

* trace txpool_content

* user sender ID inverted index to speed up txpool_content

* copy rlp from Db

* remove debug printing

* change from string to []byte

* safe storage of sender in the map

* Fix compile

* safe storage of sender in the map

* Print errors

* Prints

* Prints

* Prints

* Change worst function

* Change worst function

* Change worst function

* Change worst function

* Fix minTip

* Fix minTip

* Warn on db error, but not stop

* Fix interface

* More prints

* Cleanup

* Cleanup

* Differentiate baseFee pool

* Bump version of remove KV interface

* Not print every block

* Not print every block

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-01-25 10:20:11 +00:00
Alexandr Borodulin
ac4119191d
Encoding StarknetTx salt parameter (#243)
Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2022-01-17 13:47:16 +01:00
Alexandr Borodulin
fa6c709fcd
Encoding StarknetTx salt parameter (#240)
Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
2022-01-17 10:54:29 +01:00
Neo
26dcd28433
Update PriceBump, change tx replacement logic, update test (#238) 2022-01-17 07:45:57 +00:00
ledgerwatch
b95cff2ce3
No empty RLPs in TxPacket messages, consistent parsing of TxPacket and PooledTxPacket (#232)
* Not include empty RLPs into TransactionPacket messages

* Consistent parsing of TransactionPacket and PooledTransactionPacket

* The other way around

* Cleaner form

* Add test for encoding and parsing TransctionsPacket

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2022-01-15 09:09:33 +00:00
Alex Sharov
d4faf5beee
Rlp base err2 (#221) 2022-01-05 17:59:26 +07:00
Alex Sharov
bf21599d23
RLP: base error - allows skip them if need (#215) 2021-12-22 14:34:34 +07:00
ledgerwatch
8d06531e4e
txpool - removed mined transactions if they were missed by state stream (#213)
* Copy rlp for stream, remove txs

* Fix low nonce removal

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-17 09:35:46 +00:00
ledgerwatch
d79d43f908
Downgrade PropagatePooledTxsToPeersList to Debug (#210)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-16 21:33:33 +00:00
ledgerwatch
7f6eb71c4c
Split up txpool Broadcast and Announce (#209)
* Split up Broadcast and Announce

* Split up Broadcast and Announce

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-16 21:16:04 +00:00
ledgerwatch
7f82ddaa75
txpool broadcasting (#208)
* txpool broadcasting

* Fix lint

* Broadcast transaction to random peers

* Fix broadcast

* Fix panic

* Change terminology

* fix for broadcasting

* Rebroadcast transactions promoted to pending subpool

* Trace moving between subpools

* Deduplicate promoted hashes, fix basefee promotion

* Tx propagation to be more resilient

* Fix dedup

* Change collection of promoted hashes

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-12-16 20:58:40 +00:00
Alex Sharov
bb6dfef7c8
add downloader.proto (#206)
* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit be07fc9

git-subtree-dir: interfaces
git-subtree-split: be07fc99183a7cef1ca08961033bdb917d85d9b5

* save

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit be07fc9

git-subtree-dir: interfaces
git-subtree-split: be07fc99183a7cef1ca08961033bdb917d85d9b5

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit 23d68fd

git-subtree-dir: interfaces
git-subtree-split: 23d68fda86c3a2c322e7b430c817b06b6f6ca311

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit 500dde8

git-subtree-dir: interfaces
git-subtree-split: 500dde8293c0a12d19d94b5ff633722a03d7fc4e

* save

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit e5b1945

git-subtree-dir: interfaces
git-subtree-split: e5b1945d02da7a7f00e2289034ee90a6edd60184

* save

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit f36d878

git-subtree-dir: interfaces
git-subtree-split: f36d878080fe018a41fb903f81fc8f8ac9981cbd

* save

* save

* save
2021-12-14 13:33:32 +00:00
ledgerwatch
c7cd5d65d3
Introduce transaction tracing in tx pool (#205)
* Introduce transaction tracing in tx pool

* Add tracing prints

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-12-14 09:40:07 +00:00
TBC Dev
a27d9202e3
Refactor and simplify txpool.sendersBatch (#195)
* De-dup and extract sendersBatch.getOrCreateId()

* Misc simplify
2021-11-28 10:46:21 +00:00
ledgerwatch
0404744146
Introduce PriceBump, change tx replacement logic, add test (#192)
* Introduce PriceBump, change tx replacement logic, add test

* Fix TestNonceFromAddress

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-11-26 13:55:58 +00:00
Alex Sharov
34e6ca3c35
Pool: support multi sentry (#191)
* save

* save

* save
2021-11-24 17:13:17 +00:00
TBC Dev
d8870b19c3
Change sentry peer_id from H512 pubkey to H256 keccak256(pubkey) (#183)
* Rename h1 to h0 for clarity

* Simplify toHashes() and toPeerIDs()

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit ed9b048

git-subtree-dir: interfaces
git-subtree-split: ed9b04802fe8891a2bc3fea274c498c758d3fcac

* Change sentry peer_id from H512 pubkey to H256 keccak256(pubkey)
2021-11-21 19:35:59 +00:00
Alex Sharov
06fb85a0ed
Pool: reject low nonce and low balance txs (#182)
* save

* save
2021-11-21 14:52:17 +00:00
TBC Dev
5b0c5e7fdb
TxPool efficiency improvements (#173)
* Avoid iteration for Spammer tests by tracking senderID tx counts

* Add BySenderAndNonce.ascendAll()

* Add BySenderAndNonce.descend()

* Avoid iteration by descending, and pre-allocate known size

* Resize() once rather than for each good txn

* Use range value in loops

* Add comments to clarify NotSet default values
2021-11-18 07:59:25 +00:00
Alex Sharov
5108c95b85
txpool.Pending() method, which preserve ready-for-mining order (#172) 2021-11-17 17:23:51 +07:00
Alex Sharov
1b6c2266f5
Pool: PooledTransactions to produce correct rlp for non-legacy txs (#166) 2021-11-16 11:21:12 +07:00
ledgerwatch
eefbde1443
Pending nonce [attempt 2] (#158)
* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit 8f1a238

git-subtree-dir: interfaces
git-subtree-split: 8f1a23897b8921ae3e7f9450ec9f300255c6e1e2

* Regenerate bindings for new interfaces

* Add Nonce function

* Search for nonce in ascending order

* Descend from highest possible nonce for sender (#162)

* Descend from highest possible nonce for sender

* Remove assumptions from nonce()

* Remove interfaces for replacement

* Squashed 'interfaces/' content from commit 375e3d8

git-subtree-dir: interfaces
git-subtree-split: 375e3d85a3d9ff13e61593a5efacd2fbc777cec3

* Regenerate

* Started test

* More of test

* Fix test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: TBC Dev <48684072+tbcd@users.noreply.github.com>
2021-11-15 09:44:18 +00:00
Alex Sharov
138a208431
Pool: don't send empty events (#149) 2021-11-07 09:45:25 +07:00
Alex Sharov
3c86aa6290
ETL: use logPrefix as suffix of tmp files (#146) 2021-11-05 17:04:17 +07:00
Alex Sharov
9d5fa95729
Derive chainid no alloc (#142) 2021-11-01 11:17:16 +07:00
Alex Sharov
ce3a3dcfeb
pre-alloc uin256 for chainID derive (#141) 2021-11-01 09:42:39 +07:00
Alex Sharov
c92b760e99
make idhash public (#137) 2021-10-30 09:55:06 +07:00
alex.sharov
d0b2e02128 clean fuzz of pool 2021-10-29 09:58:52 +07:00
Alex Sharov
5d84a53060
Pool2 integration test support (#136) 2021-10-28 18:45:18 +07:00
Alex Sharov
90c6ccb789
Pool: remove rules from func signatures (#135) 2021-10-28 10:13:39 +07:00
Alex Sharov
750239d977
more p2p fuzzing, part 2 (#132) 2021-10-26 14:29:18 +07:00
alex.sharov
8ab2970ce1 more p2p fuzz 2021-10-26 14:10:42 +07:00
Alex Sharov
9558fb6a12
more p2p fuzzing (#131) 2021-10-26 13:52:23 +07:00
alex.sharov
78495d3922 pool docs 2021-10-25 09:48:15 +07:00
Alex Sharov
70c39cd195
Pool intrinsic gas check (#126) 2021-10-25 08:49:04 +07:00
alex.sharov
7693a71b4d mute useless logs 2021-10-24 18:19:52 +07:00
Alex Sharov
505bf97249
save (#124) 2021-10-22 09:41:20 +07:00
Alex Sharov
ec0155d4ed
Mdbx v0.11.0 (#123) 2021-10-22 09:12:39 +07:00
Alex Sharov
66c9c6f3f7
Pool v2: set 10K as default limit for sub-pool, check key existence before delete (#122) 2021-10-21 15:39:28 +07:00
Alex Sharov
12e69ab781
Use default crypto context - because creation of new one failing in Docker on linux host (#118) 2021-10-20 09:00:34 +07:00
alex.sharov
0efa6d9a86 fix fuzz test 2021-10-20 07:03:57 +07:00
alex.sharov
c8a357c673 fix nil pointer on error 2021-10-20 06:42:53 +07:00