Skip to content

Commit

Permalink
Removed seal parameter (#1886)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelacamarko authored Oct 10, 2023
1 parent 5e11256 commit 4d379fd
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 47 deletions.
16 changes: 8 additions & 8 deletions command/regenesis/howtotest.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ This document outlines step necessary to perform a regenesis data migration.
8. Try to start a new v0.7 chain
```bash
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --log-level DEBUG &
wait
[1] 2615
Expand Down Expand Up @@ -140,10 +140,10 @@ This document outlines step necessary to perform a regenesis data migration.
10. Run chain again
```bash
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --log-level DEBUG &
wait
[1] 2721
Expand Down
4 changes: 1 addition & 3 deletions command/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Config struct {
JSONRPCAddr string `json:"jsonrpc_addr" yaml:"jsonrpc_addr"`
Telemetry *Telemetry `json:"telemetry" yaml:"telemetry"`
Network *Network `json:"network" yaml:"network"`
ShouldSeal bool `json:"seal" yaml:"seal"`
TxPool *TxPool `json:"tx_pool" yaml:"tx_pool"`
LogLevel string `json:"log_level" yaml:"log_level"`
RestoreFile string `json:"restore_file" yaml:"restore_file"`
Expand Down Expand Up @@ -122,8 +121,7 @@ func DefaultConfig() *Config {
defaultNetworkConfig.Addr.Port,
),
},
Telemetry: &Telemetry{},
ShouldSeal: true,
Telemetry: &Telemetry{},
TxPool: &TxPool{
PriceLimit: 0,
MaxSlots: 4096,
Expand Down
2 changes: 0 additions & 2 deletions command/server/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const (
prometheusAddressFlag = "prometheus"
natFlag = "nat"
dnsFlag = "dns"
sealFlag = "seal"
maxPeersFlag = "max-peers"
maxInboundPeersFlag = "max-inbound-peers"
maxOutboundPeersFlag = "max-outbound-peers"
Expand Down Expand Up @@ -179,7 +178,6 @@ func (p *serverParams) generateConfig() *server.Config {
Chain: p.genesisConfig,
},
DataDir: p.rawConfig.DataDir,
Seal: p.rawConfig.ShouldSeal,
PriceLimit: p.rawConfig.TxPool.PriceLimit,
MaxSlots: p.rawConfig.TxPool.MaxSlots,
MaxAccountEnqueued: p.rawConfig.TxPool.MaxAccountEnqueued,
Expand Down
7 changes: 0 additions & 7 deletions command/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ func setFlags(cmd *cobra.Command) {
"the path to the archive blockchain data to restore on initialization",
)

cmd.Flags().BoolVar(
&params.rawConfig.ShouldSeal,
sealFlag,
defaultConfig.ShouldSeal,
"the flag indicating that the client should seal blocks",
)

cmd.Flags().BoolVar(
&params.rawConfig.Network.NoDiscover,
command.NoDiscoverFlag,
Expand Down
10 changes: 5 additions & 5 deletions consensus/polybft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,22 @@ It has a native support for running bridge, which enables running cross-chain tr
```bash
$ polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :9545 \
--seal --log-level DEBUG
--log-level DEBUG
$ polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :5002 --libp2p :30302 --jsonrpc :10002 \
--seal --log-level DEBUG
--log-level DEBUG
$ polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :5003 --libp2p :30303 --jsonrpc :10003 \
--seal --log-level DEBUG
--log-level DEBUG
$ polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :5004 --libp2p :30304 --jsonrpc :10004 \
--seal --log-level DEBUG
--log-level DEBUG
```
It is possible to run child chain nodes in "relayer" mode. It allows automatic execution of deposit events on behalf of users.
In order to start node in relayer mode, it is necessary to supply `--relayer` flag:
```bash
$ polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :9545 \
--seal --log-level DEBUG --relayer
--log-level DEBUG --relayer
```
10 changes: 3 additions & 7 deletions docker/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ services:
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001",
"--seal",
"--relayer"
]
depends_on:
Expand Down Expand Up @@ -81,8 +80,7 @@ services:
"--grpc-address", "0.0.0.0:9632",
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001",
"--seal"
"--prometheus", "0.0.0.0:5001"
]
depends_on:
init:
Expand All @@ -109,8 +107,7 @@ services:
"--grpc-address", "0.0.0.0:9632",
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001",
"--seal"
"--prometheus", "0.0.0.0:5001"
]
depends_on:
init:
Expand All @@ -137,8 +134,7 @@ services:
"--grpc-address", "0.0.0.0:9632",
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001",
"--seal"
"--prometheus", "0.0.0.0:5001"
]
depends_on:
init:
Expand Down
4 changes: 2 additions & 2 deletions e2e-polybft/framework/test-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ func (c *TestCluster) InitTestServer(t *testing.T,

srv := NewTestServer(t, c.Config, bridgeJSONRPC, func(config *TestServerConfig) {
config.DataDir = dataDir
config.Seal = nodeType.IsSet(Validator)
config.Validator = nodeType.IsSet(Validator)
config.Chain = c.Config.Dir("genesis.json")
config.P2PPort = c.getOpenPort()
config.LogLevel = logLevel
Expand Down Expand Up @@ -743,7 +743,7 @@ func (c *TestCluster) Stats(t *testing.T) {
}

num, err := i.JSONRPC().Eth().BlockNumber()
t.Log("Stats node", index, "err", err, "block", num, "validator", i.config.Seal)
t.Log("Stats node", index, "err", err, "block", num, "validator", i.config.Validator)
}
}

Expand Down
6 changes: 1 addition & 5 deletions e2e-polybft/framework/test-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type TestServerConfig struct {
JSONRPCPort int64
GRPCPort int64
P2PPort int64
Seal bool
Validator bool
DataDir string
Chain string
LogLevel string
Expand Down Expand Up @@ -173,10 +173,6 @@ func (t *TestServer) Start() {
args = append(args, "--log-level", "DEBUG")
}

if config.Seal {
args = append(args, "--seal")
}

if config.Relayer {
args = append(args, "--relayer")

Expand Down
16 changes: 8 additions & 8 deletions scripts/cluster
Original file line number Diff line number Diff line change
Expand Up @@ -165,30 +165,30 @@ function startServerFromBinary() {
echo "Writing validators logs to the files..."
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json \
--grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --relayer \
--num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-1.log &
--num-block-confirmations 2 --log-level DEBUG 2>&1 | tee ./validator-1.log &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json \
--grpc-address :20000 --libp2p :30302 --jsonrpc :20002 \
--num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-2.log &
--num-block-confirmations 2 --log-level DEBUG 2>&1 | tee ./validator-2.log &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json \
--grpc-address :30000 --libp2p :30303 --jsonrpc :30002 \
--num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-3.log &
--num-block-confirmations 2 --log-level DEBUG 2>&1 | tee ./validator-3.log &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json \
--grpc-address :40000 --libp2p :30304 --jsonrpc :40002 \
--num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-4.log &
--num-block-confirmations 2 --log-level DEBUG 2>&1 | tee ./validator-4.log &
wait
else
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json \
--grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --relayer \
--num-block-confirmations 2 --seal --log-level DEBUG &
--num-block-confirmations 2 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json \
--grpc-address :20000 --libp2p :30302 --jsonrpc :20002 \
--num-block-confirmations 2 --seal --log-level DEBUG &
--num-block-confirmations 2 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json \
--grpc-address :30000 --libp2p :30303 --jsonrpc :30002 \
--num-block-confirmations 2 --seal --log-level DEBUG &
--num-block-confirmations 2 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json \
--grpc-address :40000 --libp2p :30304 --jsonrpc :40002 \
--num-block-confirmations 2 --seal --log-level DEBUG &
--num-block-confirmations 2 --log-level DEBUG &
wait
fi
}
Expand Down

0 comments on commit 4d379fd

Please sign in to comment.