Skip to content

Commit

Permalink
Small adjustment to portal_bridge + docs update (#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme authored Mar 27, 2024
1 parent 8e43681 commit 058f412
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
22 changes: 20 additions & 2 deletions fluffy/docs/the_fluffy_book/docs/history-content-bridging.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
Run a Portal client with the Portal JSON-RPC API enabled, e.g. fluffy:

```bash
./build/fluffy --rpc
./build/fluffy --rpc --storage-capacity:0
```

> Note: The `--storage-capacity:0` option is not required, but it is added here
for the use case where the node its only focus is on gossiping content from the
`portal_bridge`.

#### Step 2: Run an EL client

The portal_bridge needs access to the EL JSON-RPC API, either through a local
The `portal_bridge` needs access to the EL JSON-RPC API, either through a local
Ethereum client or via a web3 provider.

#### Step 3: Run the Portal bridge in history mode
Expand All @@ -27,6 +31,20 @@ WEB3_URL="http://127.0.0.1:8546" # Replace with your provider.
./build/portal_bridge history --web3-url:${WEB3_URL}
```

Default the portal_bridge will run in `--latest` mode, which means that only the
latest block content will be gossiped into the network.

The portal_bridge also has a `--backfill` mode which will gossip pre-merge blocks
from `era1` files into the network. Default the bridge will audit first whether
the content is available on the network and if not it will gossip it into the
network.

E.g. run latest + backfill with audit mode:
```bash
WEB3_URL="http://127.0.0.1:8546" # Replace with your provider.
./build/portal_bridge history --latest:true --backfill:true --audit:true --era1-dir:/somedir/era1/ --web3-url:${WEB3_URL}
```

### Seeding post-merge history data with the `beacon_lc_bridge`

The `beacon_lc_bridge` is more of a standalone bridge that does not require access to a full node with its EL JSON-RPC API. However it is also more limited in the functions it provides.
Expand Down
2 changes: 1 addition & 1 deletion fluffy/tools/portal_bridge/portal_bridge_conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type
audit* {.
desc:
"Run pre-merge backfill in audit mode, which will only gossip content that if failed to fetch from the network",
defaultValue: false,
defaultValue: true,
name: "audit"
.}: bool

Expand Down
4 changes: 2 additions & 2 deletions fluffy/tools/portal_bridge/portal_bridge_history.nim
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ proc runLatestLoop(
let elapsed = t1 - t0
if elapsed < newHeadPollInterval:
await sleepAsync(newHeadPollInterval - elapsed)
else:
warn "Block gossip took longer than the poll interval"
elif elapsed > newHeadPollInterval * 2:
warn "Block gossip took longer than slot interval"

proc gossipHeadersWithProof(
portalClient: RpcClient,
Expand Down

0 comments on commit 058f412

Please sign in to comment.