Commit Graph

571 Commits

Author SHA1 Message Date
Kim De Mey 56caa5f62f
Add radius sort in trace lookup and logging improvements (#2905)
The radius sort performance improvement in content lookups was
not implemented in the trace version.

Also cleanup some part of the logging related to uTP connection
setup.
2024-12-04 13:59:08 +01:00
bhartnett 359eb6d974
Fluffy: Portal stream improvements and pending transfers prune fix (#2900)
* Fix defect in for loop when deleting element.

* Prune offers and requests before accepting.

* Store content requests and offers by connectionId.
2024-12-04 08:34:13 +08:00
Kim De Mey 3bf0920a16
Remove Portal beacon-lc-bridge (#2897)
The idea of the beacon-lc-bridge was to allow to bridge data into
the Portal network while only using p2p protocols to get access
to the data.

It is however incomplete as for history content the receipts are
missing. These could be added by also adding devp2p access.
But for the beacon content, there would be no way for getting the
historical summaries over p2p.

And then we did not even look yet on how to do this for state.

Considering it is incomplete it was also not being used by anyone
and thus we remove it.
2024-12-02 17:30:17 +01:00
Kim De Mey 0f18de61dc
Revert commit 6142183 and partial of b446d2a (#2898)
There is an assertion hitting due to the additon of an iterator
that deletes items from the sequence while iteratting over it.
Before the keepIf helper was used that has different code for
doing this similar work.
2024-12-02 14:09:58 +01:00
bhartnett b446d2a2e8
Fluffy: Cleanup state bridge preimages backend and add logging for transfer limit reached (#2896) 2024-12-02 16:09:43 +08:00
bhartnett 6142183d2c
Fluffy: Limit concurrent offers that can be received from each peer (#2885)
* Limit offer transfers per peer.

* Remove pending transfers in prune.

* Limit content lookups.

* Improve performance of canAddPendingTransfer and addPendingTransfer.
2024-11-29 11:31:46 +08:00
Kim De Mey c0199e8944
Fix startedAtMs in traceContentLookup to use system clock (#2891)
startedAtMs is the time passed since UNIX epoch in milliseconds.
Cannot use a monotime clock for that. As we want to keep mono
for other Moment.now() usage, imported epochTime from std/times
instead.
2024-11-28 19:05:15 +01:00
bhartnett e74d5c3f22
Fluffy: Reduce info logs when looking up state. (#2890) 2024-11-28 22:00:03 +08:00
bhartnett 23a43d1d15
Fluffy: Implement poke in state network (#2750)
* Implement poke in state network.
2024-11-28 20:33:57 +08:00
andri lim 5e90522e70
Bump nim-web3 to c8f36f59cb354196cfe117b6866e81d450c8cfd7 (#2878)
* Bump nim-web3 to c8f36f59cb354196cfe117b6866e81d450c8cfd7

* Fix portal bridge

* Comply to nph format style
2024-11-27 20:16:31 +07:00
bhartnett 6e7e63adf5
Fluffy: Make the Kademlia concurrency factor configurable via a debug parameter (#2868) 2024-11-25 20:16:27 +08:00
andri lim fbfc1611d7
Implement EIP-7702: Set EOA account code (#2631)
* Implement EIP-7702 part 1: Behavior

* Implement EIP-7702 part 2: Tx validation

* Implement EIP-7702 part 3: Delegation Designation and Gas Costs
2024-11-25 11:28:03 +01:00
bhartnett 78c5770b2f
Fluffy State Bridge: Support skipping gossip when content is found in the network (#2867) 2024-11-25 11:40:09 +08:00
Kim De Mey 453cb2f33e
portal_bridge: Add concurrency to the history content gossip (#2855) 2024-11-21 15:30:42 +01:00
Kim De Mey 107db3ae16
fluffy: revert iplimit/bitperhop debug flags (#2860)
Revert for now to their previous names to avoid fluffy fleet
breakage.
2024-11-21 13:36:18 +01:00
bhartnett 4b63cdeaac
Remove direct local content lookup from PortalRpcClient. (#2857) 2024-11-21 20:20:09 +08:00
bhartnett 508ce79cdd
Fluffy: Log nodeId when receiving offers (#2856)
* Log nodeId when receiving offers.
2024-11-21 20:17:38 +08:00
Kim De Mey b671499fdc
fluffy: Make concurrent offers configurable at cli (#2854) 2024-11-21 04:05:33 +07:00
Kim De Mey 3ea5c531d1
portal_bridge history: fully support gossip of block by number (#2853)
+ some minor cleanup & reuse of code
2024-11-20 14:07:36 +01:00
Kim De Mey d496793fa6
fluffy/portal: Add missing imports (#2851)
Would/could fail compilation when using portal_node as module,
depending on import order.
2024-11-19 15:38:10 +01:00
Kim De Mey 32b5b8a173
Fluffy guide: fix formatting for development status docs (#2850) 2024-11-18 10:30:23 +01:00
Kim De Mey d643556d4b
fluffy.guide: Update development status (#2846) 2024-11-07 17:17:40 +01:00
bhartnett 9dceb58ad0
Fluffy: Prioritize nodes that have radius in range of target content in lookup (#2841)
* Prioritize nodes that have radius in range of target content in content lookup.
2024-11-07 16:59:59 +08:00
Kim De Mey eaf98dccb1
Change some spammy info/error logs to debug (#2840)
These logs are not really usful to an end user, and are rather
for developers, so we move them to debug.
2024-11-06 15:44:20 +01:00
Kim De Mey cff7091826
Fix flaky portal tests - part II (#2829)
* Remove two simple sleeps from history network test

Replace simple sleeps in test_history_network with retries +
sleeps. Current simple sleep setting would occasionally still
fail on CI.

* Increase retries on test_portal_testnet from 2 to 3.

* Add 1 second sleep after headers with proof get gossiped
2024-11-06 11:10:31 +01:00
Kim De Mey 6374bfb39c
Refactor/clean-up/prepping history network code (#2836)
- Move any validation related code to new file
- Move any type conversion related code to new file
- Prepare validation code for adding different type of canonical
proofs
- Prepare for validation code for json-rpc api
- several other clean-ups and renames

Sort of a first pass as the validation code specifically can
use some further changes.
2024-11-06 08:49:55 +01:00
Kim De Mey 226d084e90
Fix flaky test_portal_testnet CI test with retries (#2808)
* Add two, not so great, quick fix attempts for flaky CI

* Another attempt

* Remove the increased sleep in test_history_network

Need something better here.
2024-11-04 18:02:56 +01:00
Kim De Mey 73b228fb1d
Remove EpochRecord getContent (#2828)
EpochRecord type is removed from the network.

And avoid a deprecation warning in portal_bridge.
2024-11-04 16:53:37 +01:00
bhartnett 22653c83dd
Fluffy: Implement contains db handler to improve lookup performance when accepting offers (#2815)
* Remove getSszDecoded from ContentDb.

* Update ContentDb get to use onData callback to reduce copies.

* Use templates for helper procs in ContentDb.

* Add contains handler to portal protocol.

* Improve performance of DbGetHandler.
2024-11-04 22:02:51 +08:00
tersec 73661fd8a4
switch to Nim v2.0.12 (#2817)
* switch to Nim v2.0.12

* fix LruCache capitalization for styleCheck

* KzgProof/KzgCommitment for styleCheck

* TxEip4844 for styleCheck

* styleCheck issues in nimbus/beacon/payload_conv.nim

* ENode for styleCheck

* isOk for styleCheck

* some more styleCheck fixes

* more styleCheck fixes

---------

Co-authored-by: jangko <jangko128@gmail.com>
2024-11-01 19:06:26 +00:00
Kim De Mey 8be105ceaa
Default enable Portal beacon subnetwork (#2806) 2024-10-30 23:26:49 +01:00
Kim De Mey bef4c05561
Add custom json-rpc method to initialize the trusted block root (#2805) 2024-10-30 18:32:36 +01:00
bhartnett 8d8f62bf67
Fluffy: Improve logging and add offer metrics to status logs. (#2802)
* Set offer processing logs to debug level and add offer counts to state network.

* Use metrics instead of int counters and remove from logs.

* More logging improvements. Make decoding and validation failures use error log level.

* Add protocol_id to metrics.
2024-10-30 21:17:16 +08:00
Kim De Mey e038a383c1
Add pruning of bootstraps/updates in Portal beacon network (#2779) 2024-10-30 12:51:00 +01:00
Kim De Mey 85d8ed7be1
Adjust ForkDigest dynamically in Portal beacon content tests (#2778)
Also iterates over multiple dirs now to run tests for each fork.
2024-10-27 08:34:50 +01:00
Jacek Sieka 6b2d341ebb
simplify genesis generation code (#2786)
* remove redundant abstraction
* fix misleading raises - the implementation actually swallows errors or
panics (depending on how many other layers of abstraction we penetrate
before detecting it)
2024-10-26 16:26:38 +07:00
bhartnett ca24dd915f
Fluffy: Make content request retries configurable (#2770)
* Make content request retries configurable and add to state network and history network.

* Set retries to 1. Use uint to prevent negative values. Make contentRequestRetries a debug parameter.
2024-10-25 15:15:01 +08:00
Kim De Mey 3d31911f1d
Portal beacon: Remove unneeded and confusing (fork specific) imports (#2776) 2024-10-24 20:31:17 +02:00
Jacek Sieka 5fc4c13ab1
Increase JSON-RPC limits, bump json-rpc (#2759)
* blocks can be bigger than the default 1mb when json-rpc-encoded - this
happens on sepolia for example
* json-rpc bump improves debug logging and fixes a number of bugs
* json-serialization bump fixes a crash on invalid arrays in json data

At some point, it would probably be better to compute the maximum block
size from actual block constraints, though this is somewhat tricky and
depends on gas limits etc. Until then, 16mb should be plenty.

With this, sepolia can be synced :)
2024-10-23 10:26:56 +02:00
andri lim 133387e6a7
Rework EIP-6110, EIP-7002, and EIP-7251: Pectra execution requests (#2734)
* Rework EIP-6110, EIP-7002, and EIP-7251

* Bump nimbus-eth2
2024-10-18 16:38:18 +07:00
bhartnett 47337593c9
Fluffy: Enable content cache for history network (#2745)
* Cache content after lookups in history network.

* Cleanup config in PortalProtocol.

* Use local content lookup in history network to enable using cache.
2024-10-17 16:25:53 +08:00
bhartnett 54528fb24b
Fluffy: Enable content cache for state network (#2739)
* Enable content cache for state network.

* Update state json-rpc endpoints to return local content which uses cache if enabled.

* Add content cache metrics.

* Make content cache configurable.

* Add content cache tests.
2024-10-16 21:05:39 +08:00
Kim De Mey 4191f95527
Add Docker quickstart page for Fluffy + minor docs fixes (#2744) 2024-10-16 14:56:52 +02:00
Kim De Mey b885f822d0
More clean-up since eth types refactor (#2742) 2024-10-16 14:18:02 +02:00
Kim De Mey f797d55c35
Fix, improve and update some of the fluffy docs (#2743) 2024-10-16 13:48:34 +02:00
andri lim 1126c7700d
Bump nim-eth and nimbus-eth2 (#2741)
* Bump nim-eth and nimbus-eth2

* Fix ambiguous identifier
2024-10-16 13:51:38 +07:00
Chirag Parmar 2838191c4f
replace deprecated types (#2704)
* partial commit

* fixes

* remove converters too

* revert changes on nimbus_verified_proxy

* revert changes in converter

* revert changes(re-xport) in rpc_types

* update copyright year

* replace types in other binaries

* chain config bug

* fix rebase conflict imcomplete buffer

* fix more rebase buffers

* remove ditto types and converters

* fix the tests

* update copyright year
2024-10-16 08:34:12 +07:00
Kim De Mey 9c9a41a16d
More verbose error handling for Portal stream content reading (#2737) 2024-10-14 11:53:28 +02:00
bhartnett bdbea9853e
Rename Fluffy rpc methods to match updated spec (#2735) 2024-10-14 16:46:35 +08:00
Kim De Mey 3e36f52fd7
Rename the debug docker files + add a simpler/faster one for Linux (#2731)
Also update related documentation
2024-10-13 18:07:17 +02:00