Skip to content

Commit

Permalink
feat: test network long blocks (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Oct 9, 2023
1 parent 64c1c8e commit 2bb0195
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions consensus/ibft/signer/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Test_wrapCommitHash(t *testing.T) {
assert.Equal(t, expectedOutput, output)
}

// nolint
//nolint
func Test_getOrCreateECDSAKey(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -184,7 +184,7 @@ func Test_getOrCreateECDSAKey(t *testing.T) {
}
}

// nolint
//nolint
func Test_getOrCreateBLSKey(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 5 additions & 1 deletion docker/local-topos/polygon-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CONTRACTS_PATH=/contracts
GENESIS_PATH=/data/genesis.json
CHAIN_ID="${CHAIN_ID:-100}" # 100 is Edge's default value
NUMBER_OF_NODES="${NUMBER_OF_NODES:-4}" # Number of subnet nodes in the consensus
BLOCK_TIME="${BLOCK_TIME:-2s}" # Block time in seconds
BOOTNODE_DOMAIN_NAME="${BOOTNODE_DOMAIN_NAME:-node-1}"
CHAIN_CUSTOM_OPTIONS=$(tr "\n" " " << EOL
--block-gas-limit 10000000
Expand Down Expand Up @@ -46,6 +47,7 @@ case "$1" in
cd /data && /polygon-edge/polygon-edge genesis $CHAIN_CUSTOM_OPTIONS \
--dir genesis.json \
--consensus ibft \
--block-time $BLOCK_TIME \
--ibft-validators-prefix-path data- \
--max-validator-count=$NUMBER_OF_NODES \
--min-validator-count=1 \
Expand Down Expand Up @@ -76,6 +78,7 @@ case "$1" in
"$POLYGON_EDGE_BIN" genesis $CHAIN_CUSTOM_OPTIONS \
--dir "$GENESIS_PATH" \
--consensus polybft \
--block-time $BLOCK_TIME \
--manifest /data/manifest.json \
--max-validator-count=$NUMBER_OF_NODES \
--min-validator-count=1 \
Expand Down Expand Up @@ -104,13 +107,14 @@ case "$1" in
echo "Generating genesis script..."
"$POLYGON_EDGE_BIN" genesis --dir genesis.json \
--consensus ibft \
--block-time $BLOCK_TIME \
--ibft-validators-prefix-path data- \
--max-validator-count=1 \
--min-validator-count=1 \
--premine=0x4AAb25B4fAd0Beaac466050f3A7142A502f4Cf0a:1000000000000000000000 \
--bootnode /ip4/127.0.0.1/tcp/10001/p2p/$NODE_ID

echo "Executing polygon-edge standalone node..."
echo "Executing polygon-edge standalone node with block time " $BLOCK_TIME
exec "$POLYGON_EDGE_BIN" server --data-dir ./data-1 --chain genesis.json
;;

Expand Down
2 changes: 0 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ func (j *jsonRPCHub) GetAccount(root types.Hash, addr types.Address) (*jsonrpc.A
return account, nil
}

// TODO: use eth_getProof once it is available in Polygon Edge
func (j *jsonRPCHub) GetAccountProof(root types.Hash, addr types.Address) ([][]byte, error) {
proof, err := getAccountProofImpl(j.state, root, addr)
if err != nil {
Expand Down Expand Up @@ -739,7 +738,6 @@ func (j *jsonRPCHub) GetStorage(stateRoot types.Hash, addr types.Address, slot t
return res.Bytes(), nil
}

// TODO: use eth_getProof once it is available in Polygon Edge
func (j *jsonRPCHub) GetStorageProof(stateRoot types.Hash, addr types.Address, slot types.Hash) ([][]byte, error) {
account, err := getAccountImpl(j.state, stateRoot, addr)
if err != nil {
Expand Down

0 comments on commit 2bb0195

Please sign in to comment.