Skip to content

Commit

Permalink
Speed up epoch loading, and cleanup log verbosity (#85)
Browse files Browse the repository at this point in the history
* Speed up split epoch loading

* Fix miner info printing

* Use klog verbosity levels; max is 5

* Cleanup TODOs

* Cleanup logs; remove sigexists index warmup

* Add log levels to README

* Fix log defaults
  • Loading branch information
gagliardetto authored Feb 14, 2024
1 parent de40873 commit a78c1c3
Show file tree
Hide file tree
Showing 24 changed files with 483 additions and 279 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ The RPC server provides a proxy mode which allows it to forward traffic it can't

The `proxyFailedRequests` flag will make the RPC server proxy not only RPC methods that it doesn't support, but also retry requests that failed to be served from the archives (e.g. a `getBlock` request that failed to be served from the archives because that epoch is not available).

### Log Levels

You can set the desired log verbosity level by using the `-v` flag. The levels are from 0 to 5, where 0 is the least verbose and 5 is the most verbose. The default level is 2.

Example:

```bash
faithful-cli rpc -v=5 455.yml
```

### RPC server from old-faithful.net

We are hosting data on old-faithful.net for testing and cloning purposes. This allows you to run a sample test server without downloading any data. You can run a fully remote server like this:
Expand Down
3 changes: 1 addition & 2 deletions car-dag-traverser.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ func FindSubsets(
}
decoded, err := iplddecoders.DecodeSubset(block.RawData())
if err != nil {
// TODO: log error, or return error?
continue
return fmt.Errorf("failed to decode Subset with CID %s: %w", block.Cid(), err)
}
err = callback(block.Cid(), decoded)
if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions cmd-check-deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ func newCmd_check_deals() *cli.Command {
klog.Infof("Provider allowlist: <empty>")
}

lotusAPIAddress := "https://api.node.glif.io"
cl := jsonrpc.NewClient(lotusAPIAddress)
dm := splitcarfetcher.NewMinerInfo(
cl,
24*time.Hour,
5*time.Second,
)

// Check deals:
for _, config := range configs {
epoch := *config.Epoch
Expand All @@ -134,21 +142,13 @@ func newCmd_check_deals() *cli.Command {
return fmt.Errorf("failed to read deals: %w", err)
}

lotusAPIAddress := "https://api.node.glif.io"
cl := jsonrpc.NewClient(lotusAPIAddress)
dm := splitcarfetcher.NewMinerInfo(
cl,
5*time.Minute,
5*time.Second,
)

err = checkAllPieces(
c.Context,
epoch,
metadata,
dealRegistry,
providerAllowlist,
&dm,
dm,
)
if err != nil {
return fmt.Errorf(
Expand Down
Loading

0 comments on commit a78c1c3

Please sign in to comment.