Skip to content

Commit

Permalink
[deba] make order gossip work with new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
debaghtk committed Mar 21, 2024
1 parent 5e94284 commit 20bb85f
Show file tree
Hide file tree
Showing 20 changed files with 268 additions and 637 deletions.
12 changes: 10 additions & 2 deletions chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 500,
"priority-regossip-txs-per-address": 200,
"priority-regossip-addresses": ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC"],
"priority-regossip-addresses": [
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
"0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC"
],
"validator-private-key-file": "/tmp/validator.pk",
"is-validator": true,
"trading-api-enabled": true,
"testing-api-enabled": true,
"load-from-snapshot-enabled": true,
"snapshot-file-path": "/tmp/snapshot",
"makerbook-database-path": "/tmp/makerbook"
"makerbook-database-path": "/tmp/makerbook",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
9 changes: 7 additions & 2 deletions network-configs/aylin/chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 32,
"priority-regossip-txs-per-address": 20,
"priority-regossip-addresses": ["0x06CCAD927e6B1d36E219Cb582Af3185D0705f78F"],
"priority-regossip-addresses": [
"0x06CCAD927e6B1d36E219Cb582Af3185D0705f78F"
],
"validator-private-key-file": "/home/ubuntu/validator.pk",
"feeRecipient": "<insert address corresponding to private key above>",
"is-validator": true,
"snapshot-file-path": "/tmp/snapshot",
"makerbook-database-path": "/tmp/makerbook"
"makerbook-database-path": "/tmp/makerbook",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
23 changes: 20 additions & 3 deletions network-configs/aylin/chain_api_node.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 32,
"priority-regossip-txs-per-address": 20,
"priority-regossip-addresses": ["0x06CCAD927e6B1d36E219Cb582Af3185D0705f78F"],
"priority-regossip-addresses": [
"0x06CCAD927e6B1d36E219Cb582Af3185D0705f78F"
],
"coreth-admin-api-enabled": true,
"eth-apis": ["public-eth","public-eth-filter","net","web3","internal-eth","internal-blockchain","internal-transaction","internal-debug","internal-tx-pool","internal-account","debug-tracer"],
"eth-apis": [
"public-eth",
"public-eth-filter",
"net",
"web3",
"internal-eth",
"internal-blockchain",
"internal-transaction",
"internal-debug",
"internal-tx-pool",
"internal-account",
"debug-tracer"
],
"trading-api-enabled": true,
"testing-api-enabled": true,
"snapshot-file-path": "/tmp/snapshot",
"makerbook-database-path": "/tmp/makerbook"
"makerbook-database-path": "/tmp/makerbook",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
23 changes: 20 additions & 3 deletions network-configs/aylin/chain_archival_node.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,28 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 32,
"priority-regossip-txs-per-address": 20,
"priority-regossip-addresses": ["0x06CCAD927e6B1d36E219Cb582Af3185D0705f78F"],
"priority-regossip-addresses": [
"0x06CCAD927e6B1d36E219Cb582Af3185D0705f78F"
],
"coreth-admin-api-enabled": true,
"eth-apis": ["public-eth","public-eth-filter","net","web3","internal-public-eth","internal-blockchain","internal-transaction","internal-debug","internal-tx-pool","internal-account","debug-tracer"],
"eth-apis": [
"public-eth",
"public-eth-filter",
"net",
"web3",
"internal-public-eth",
"internal-blockchain",
"internal-transaction",
"internal-debug",
"internal-tx-pool",
"internal-account",
"debug-tracer"
],
"trading-api-enabled": true,
"testing-api-enabled": true,
"snapshot-file-path": "/tmp/snapshot",
"makerbook-database-path": "/tmp/makerbook"
"makerbook-database-path": "/tmp/makerbook",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"proposerMinBlockDelay": 0,
"appGossipValidatorSize": 10,
"appGossipNonValidatorSize": 5,
"appGossipPeerSize": 15
}
{
"proposerMinBlockDelay": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"proposerMinBlockDelay": 0,
"appGossipValidatorSize": 10,
"appGossipNonValidatorSize": 5,
"appGossipPeerSize": 15
"proposerMinBlockDelay": 0
}
23 changes: 20 additions & 3 deletions network-configs/hubblenet/chain_api_node.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,31 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 32,
"priority-regossip-txs-per-address": 20,
"priority-regossip-addresses": ["0x8747adFCE380492ec7e9b78761Ec7C87F5Cd3d4F"],
"priority-regossip-addresses": [
"0x8747adFCE380492ec7e9b78761Ec7C87F5Cd3d4F"
],
"continuous-profiler-dir": "/var/avalanche/profiles/hubblenet/continuous/",
"continuous-profiler-max-files": 200,
"continuous-profiler-frequency": "10m",
"admin-api-enabled": true,
"eth-apis": ["public-eth","public-eth-filter","net","web3","internal-public-eth","internal-blockchain","internal-transaction","internal-debug","internal-tx-pool","internal-account","debug-tracer"],
"eth-apis": [
"public-eth",
"public-eth-filter",
"net",
"web3",
"internal-public-eth",
"internal-blockchain",
"internal-transaction",
"internal-debug",
"internal-tx-pool",
"internal-account",
"debug-tracer"
],
"trading-api-enabled": true,
"testing-api-enabled": true,
"snapshot-file-path": "/tmp/snapshot",
"makerbook-database-path": "/tmp/makerbook"
"makerbook-database-path": "/tmp/makerbook",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
23 changes: 20 additions & 3 deletions network-configs/hubblenet/chain_archival_node.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,31 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 32,
"priority-regossip-txs-per-address": 20,
"priority-regossip-addresses": ["0x8747adFCE380492ec7e9b78761Ec7C87F5Cd3d4F"],
"priority-regossip-addresses": [
"0x8747adFCE380492ec7e9b78761Ec7C87F5Cd3d4F"
],
"continuous-profiler-dir": "/var/avalanche/profiles/hubblenet/continuous/",
"continuous-profiler-max-files": 200,
"continuous-profiler-frequency": "10m",
"admin-api-enabled": true,
"eth-apis": ["public-eth","public-eth-filter","net","web3","internal-public-eth","internal-blockchain","internal-transaction","internal-debug","internal-tx-pool","internal-account","debug-tracer"],
"eth-apis": [
"public-eth",
"public-eth-filter",
"net",
"web3",
"internal-public-eth",
"internal-blockchain",
"internal-transaction",
"internal-debug",
"internal-tx-pool",
"internal-account",
"debug-tracer"
],
"trading-api-enabled": true,
"testing-api-enabled": true,
"snapshot-file-path": "/tmp/snapshot",
"makerbook-database-path": "/tmp/makerbook"
"makerbook-database-path": "/tmp/makerbook",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
9 changes: 7 additions & 2 deletions network-configs/hubblenet/chain_validator_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
"tx-regossip-max-size": 32,
"priority-regossip-max-txs": 32,
"priority-regossip-txs-per-address": 20,
"priority-regossip-addresses": ["0x8747adFCE380492ec7e9b78761Ec7C87F5Cd3d4F"],
"priority-regossip-addresses": [
"0x8747adFCE380492ec7e9b78761Ec7C87F5Cd3d4F"
],
"continuous-profiler-dir": "/var/avalanche/profiles/hubblenet/continuous/",
"continuous-profiler-max-files": 200,
"continuous-profiler-frequency": "10m",
"validator-private-key-file": "/var/avalanche/validator.pk",
"feeRecipient": "0xa5e31FbE901362Cc93b6fdab99DB9741c673a942",
"is-validator": true,
"snapshot-file-path": "/tmp/snapshot"
"snapshot-file-path": "/tmp/snapshot",
"order-gossip-num-validators": 10,
"order-gossip-num-non-validators": 5,
"order-gossip-num-peers": 15
}
5 changes: 5 additions & 0 deletions plugin/evm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ type Config struct {
RegossipFrequency Duration `json:"regossip-frequency"`
PriorityRegossipAddresses []common.Address `json:"priority-regossip-addresses"`

// Order Gossip Settings
OrderGossipNumValidators int `json:"order-gossip-num-validators"`
OrderGossipNumNonValidators int `json:"order-gossip-num-non-validators"`
OrderGossipNumPeers int `json:"order-gossip-num-peers"`

// Log
LogLevel string `json:"log-level"`
LogJSONFormat bool `json:"log-json-format"`
Expand Down
32 changes: 6 additions & 26 deletions plugin/evm/gossip_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,15 @@ var _ GossipStats = &gossipStats{}
// GossipStats contains methods for updating incoming and outgoing gossip stats.
type GossipStats interface {
IncEthTxsGossipReceived()

// new vs. known txs received
IncEthTxsGossipReceivedError()
IncEthTxsGossipReceivedKnown()
IncEthTxsGossipReceivedNew()

IncSignedOrdersGossipReceived(count int64)
IncSignedOrdersGossipBatchReceived()

// new vs. known txs received
IncSignedOrdersGossipReceivedKnown()
IncSignedOrdersGossipReceivedNew()
IncSignedOrdersGossipReceiveError()
}

// GossipSentStats groups functions for outgoing gossip stats.
type GossipSentStats interface {
IncEthTxsGossipSent()

// regossip
IncEthTxsRegossipQueued()
IncEthTxsRegossipQueuedLocal(count int)
IncEthTxsRegossipQueuedRemote(count int)

IncSignedOrdersGossipSent(count int64)
IncSignedOrdersGossipBatchSent()
Expand All @@ -42,27 +28,21 @@ type GossipSentStats interface {

// gossipStats implements stats for incoming and outgoing gossip stats.
type gossipStats struct {
// messages
ethTxsGossipReceived metrics.Counter

// new vs. known txs received
ethTxsGossipReceived metrics.Counter
ethTxsGossipReceivedError metrics.Counter
ethTxsGossipReceivedKnown metrics.Counter
ethTxsGossipReceivedNew metrics.Counter

// messages
signedOrdersGossipSent metrics.Counter
signedOrdersGossipBatchSent metrics.Counter
signedOrdersGossipSendError metrics.Counter
signedOrdersGossipOrderExpired metrics.Counter
signedOrdersGossipReceived metrics.Counter
signedOrdersGossipBatchReceived metrics.Counter

// regossip
// new vs. known txs received
signedOrdersGossipReceivedKnown metrics.Counter
signedOrdersGossipReceivedNew metrics.Counter
signedOrdersGossipReceiveError metrics.Counter

signedOrdersGossipSent metrics.Counter
signedOrdersGossipBatchSent metrics.Counter
signedOrdersGossipSendError metrics.Counter
signedOrdersGossipOrderExpired metrics.Counter
}

func NewGossipStats() GossipStats {
Expand Down
Loading

0 comments on commit 20bb85f

Please sign in to comment.