Skip to content

Commit

Permalink
Merge pull request #136 from ethpandaops/revert/network
Browse files Browse the repository at this point in the history
revert: #130
  • Loading branch information
Savid authored Jun 13, 2023
2 parents 0fddba4 + ba6d975 commit ab849fa
Show file tree
Hide file tree
Showing 37 changed files with 229 additions and 518 deletions.
2 changes: 2 additions & 0 deletions docs/discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ P2P configuration to get node records to discover from the [Xatu server coordina
| p2p.config.discV4 | bool | `true` | enable Node Discovery Protocol v4 *Note: both Node Discovery Protocol v4 and v5 can be enabled at the same time* |
| p2p.config.discV5 | bool | `true` | enable Node Discovery Protocol v5 *Note: both Node Discovery Protocol v4 and v5 can be enabled at the same time* |
| p2p.config.restart | string | `2m` | Time between initiating discovery scans and fetching new node record, will generate a fresh private key each time |
| p2p.config.networkIds | array<string> | | List of network ids to filter node records by (decimal format, eg. '1' for mainnet) |
| p2p.config.forkIdHashes | array<string> | | List of [Fork ID hash](https://eips.ethereum.org/EIPS/eip-2124) to filter node records by (hex string) |

### P2P `static` configuration
Expand Down Expand Up @@ -112,6 +113,7 @@ p2p:
discV4: true
discV5: true
restart: 2m
networkIds: [1]
forkIdHashes: [0xf0afd0e3]
```
Expand Down
5 changes: 5 additions & 0 deletions docs/mimicry.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Output configuration to send mimicry events to a [Xatu server](./server.md).
| outputs[].config.batchTimeout | string | `5s` | The maximum duration for constructing a batch. Processor forcefully sends available events when timeout is reached |
| outputs[].config.exportTimeout | string | `30s` | The maximum duration for exporting events. If the timeout is reached, the export will be cancelled |
| outputs[].config.maxExportBatchSize | int | `512` | MaxExportBatchSize is the maximum number of events to process in a single batch. If there are more than one batch worth of events then it processes multiple batches of events one batch after the other without any delay |
| outputs[].config.networkIds | array<string> | | List of network ids to connect to (decimal format, eg. '1' for mainnet) |
| outputs[].config.forkIdHashes | array<string> | | List of [Fork ID hash](https://eips.ethereum.org/EIPS/eip-2124) to connect to (hex string) |
| outputs[].config.maxPeers | int | `100` | Max number of peers to attempt to connect to simultaneously |

Expand All @@ -123,6 +124,7 @@ coordinator:
type: xatu
config:
address: localhost:8080
networkIds: [1]
forkIdHashes: [0xf0afd0e3]
maxPeers: 100

Expand Down Expand Up @@ -157,6 +159,7 @@ coordinator:
type: xatu
config:
address: localhost:8080
networkIds: [1]
forkIdHashes: [0xf0afd0e3]

outputs:
Expand All @@ -175,6 +178,7 @@ coordinator:
type: xatu
config:
address: localhost:8080
networkIds: [1]
forkIdHashes: [0xf0afd0e3]

outputs:
Expand Down Expand Up @@ -204,6 +208,7 @@ coordinator:
type: xatu
config:
address: localhost:8080
networkIds: [1]
forkIdHashes: [0xf0afd0e3]

outputs:
Expand Down
32 changes: 0 additions & 32 deletions docs/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ Server requires a single `yaml` config file. An example file can be found [here]
| addr | string | `:8080` | The grpc address for [services](#services) |
| labels | object | | A key value map of labels to append to every sentry event |
| ntpServer | string | `pool.ntp.org` | NTP server to calculate clock drift for events |
| ethereum.network.name | string | | Ethereum network name |
| ethereum.network.id | int | | Ethereum network chain ID |
| ethereum.network.spec.secondsPerSlot | int | | Seconds per slot |
| ethereum.network.spec.slotsPerEpoch | int | | Slots per epoch |
| ethereum.network.spec.genesisTime | int | | Genesis time |
| persistence.enabled | bool | `false` | Enable persistence |
| persistence.driverName | string | `postgres` | Persistence driver name (`postgres`) |
| persistence.connectionString | string | | Connection string for the persistence driver |
Expand Down Expand Up @@ -115,15 +110,6 @@ GeoIP configuration for MaxMind.
Simple example that runs on default ports and enables the [Coordinator](./server.md#coordinator) and [Event Ingester](./server.md#event-ingester) services.

```yaml
ethereum:
network:
name: "mainnet"
id: 1
spec:
secondsPerSlot: 12
slotsPerEpoch: 32
genesisTime: 1606824023

services:
coordinator:
enabled: true
Expand All @@ -140,15 +126,6 @@ services:
### Only run the event exporter example
```yaml
ethereum:
network:
name: "mainnet"
id: 1
spec:
secondsPerSlot: 12
slotsPerEpoch: 32
genesisTime: 1606824023

services:
eventIngester:
enabled: true
Expand All @@ -174,15 +151,6 @@ labels:

ntpServer: time.google.com

ethereum:
network:
name: "mainnet"
id: 1
spec:
secondsPerSlot: 12
slotsPerEpoch: 32
genesisTime: 1606824023

persistence:
enabled: true
driverName: postgres
Expand Down
1 change: 1 addition & 0 deletions example_discovery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ p2p:
# discV4: true
# discV5: true
# restart: 2m
# networkIds: [1]
# forkIdHashes: [0xf0afd0e3]
1 change: 1 addition & 0 deletions example_mimicry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ coordinator:
# tls: false
# headers:
# authorization: Someb64Value
# networkIds: [1]
# forkIdHashes: [0xf0afd0e3]
# maxPeers: 100

Expand Down
23 changes: 0 additions & 23 deletions example_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,6 @@ labels:
# pool.ntp.org - https://www.pool.ntp.org/zone/@
ntpServer: time.google.com

ethereum:
network:
name: "mainnet"
id: 1
spec:
secondsPerSlot: 12
slotsPerEpoch: 32
genesisTime: 1606824023

# name: "goerli"
# id: 5
# spec:
# secondsPerSlot: 12
# slotsPerEpoch: 32
# genesisTime: 1616508000

# name: "sepolia"
# id: 11155111
# spec:
# secondsPerSlot: 12
# slotsPerEpoch: 32
# genesis_time: 1655733600

persistence:
enabled: false
# driverName: postgres
Expand Down
1 change: 1 addition & 0 deletions pkg/discovery/p2p/xatu/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Config struct {
DiscV4 bool `yaml:"discV4" default:"true"`
DiscV5 bool `yaml:"discV5" default:"true"`
Restart time.Duration `yaml:"restart" default:"2m"`
NetworkIds []uint64 `yaml:"networkIds"`
ForkIDHashes []string `yaml:"forkIdHashes"`
}

Expand Down
1 change: 1 addition & 0 deletions pkg/discovery/p2p/xatu/xatu.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (c *Coordinator) startCrons(ctx context.Context) error {
}

req := xatu.GetDiscoveryNodeRecordRequest{
NetworkIds: c.config.NetworkIds,
ForkIdHashes: forkIDHashes,
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/mimicry/coordinator/xatu/coordinator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Config struct {
Address string `yaml:"address"`
Headers map[string]string `yaml:"headers"`
TLS bool `yaml:"tls" default:"false"`
NetworkIds []uint64 `yaml:"networkIds"`
ForkIDHashes []string `yaml:"forkIdHashes"`
MaxPeers uint32 `yaml:"maxPeers" default:"100"`
}
Expand All @@ -17,5 +18,9 @@ func (c *Config) Validate() error {
return errors.New("address is required")
}

if len(c.NetworkIds) == 0 {
return errors.New("networkIds is required")
}

return nil
}
1 change: 1 addition & 0 deletions pkg/mimicry/coordinator/xatu/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (c *Coordinator) CoordinateExecutionNodeRecords(ctx context.Context, record
}

req := xatu.CoordinateExecutionNodeRecordsRequest{
NetworkIds: c.config.NetworkIds,
ForkIdHashes: forkIDHashes,
NodeRecords: records,
Limit: c.config.MaxPeers,
Expand Down
Loading

0 comments on commit ab849fa

Please sign in to comment.