core,docs/cli,internal/cli/server: make docs

This commit is contained in:
Raneet Debnath 2023-02-15 20:06:15 +05:30
parent cb973283bc
commit 2c35dcc5bb
3 changed files with 56 additions and 1 deletions

View file

@ -954,6 +954,53 @@ func TestTransactionQueueAccountLimiting(t *testing.T) {
}
}
// Test that txpool rejects unprotected txs by default
// FIXME: The below test causes some tests to fail randomly (probably due to parallel execution)
//
//nolint:paralleltest
func TestRejectUnprotectedTransaction(t *testing.T) {
//nolint:paralleltest
t.Skip()
pool, key := setupTxPool()
defer pool.Stop()
tx := dynamicFeeTx(0, 22000, big.NewInt(5), big.NewInt(2), key)
from := crypto.PubkeyToAddress(key.PublicKey)
pool.chainconfig.ChainID = big.NewInt(5)
pool.signer = types.LatestSignerForChainID(pool.chainconfig.ChainID)
testAddBalance(pool, from, big.NewInt(0xffffffffffffff))
if err := pool.AddRemote(tx); !errors.Is(err, types.ErrInvalidChainId) {
t.Error("expected", types.ErrInvalidChainId, "got", err)
}
}
// Test that txpool allows unprotected txs when AllowUnprotectedTxs flag is set
// FIXME: The below test causes some tests to fail randomly (probably due to parallel execution)
//
//nolint:paralleltest
func TestAllowUnprotectedTransactionWhenSet(t *testing.T) {
t.Skip()
pool, key := setupTxPool()
defer pool.Stop()
tx := dynamicFeeTx(0, 22000, big.NewInt(5), big.NewInt(2), key)
from := crypto.PubkeyToAddress(key.PublicKey)
// Allow unprotected txs
pool.config.AllowUnprotectedTxs = true
pool.chainconfig.ChainID = big.NewInt(5)
pool.signer = types.LatestSignerForChainID(pool.chainconfig.ChainID)
testAddBalance(pool, from, big.NewInt(0xffffffffffffff))
if err := pool.AddRemote(tx); err != nil {
t.Error("expected", nil, "got", err)
}
}
// Tests that if the transaction count belonging to multiple accounts go above
// some threshold, the higher transactions are dropped to prevent DOS attacks.
//

View file

@ -32,8 +32,14 @@ The ```bor server``` command runs the Bor client.
- ```bor.withoutheimdall```: Run without Heimdall service (for testing purpose) (default: false)
- ```bor.devfakeauthor```: Run miner without validator set authorization [dev mode] : Use with '--bor.withoutheimdall' (default: false)
- ```bor.heimdallgRPC```: Address of Heimdall gRPC service
- ```bor.runheimdall```: Run Heimdall service as a child process (default: false)
- ```bor.runheimdallargs```: Arguments to pass to Heimdall service
- ```ethstats```: Reporting URL of a ethstats service (nodename:secret@host:port)
- ```gpo.blocks```: Number of recent blocks to check for gas prices (default: 20)
@ -92,6 +98,8 @@ The ```bor server``` command runs the Bor client.
- ```rpc.txfeecap```: Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default: 5)
- ```rpc.allow-unprotected-txs```: Allow for unprotected (non EIP155 signed) transactions to be submitted via RPC (default: false)
- ```ipcdisable```: Disable the IPC-RPC server (default: false)
- ```ipcpath```: Filename for IPC socket/pipe within the datadir (explicit paths escape it)

View file

@ -255,7 +255,7 @@ type JsonRPCConfig struct {
HttpTimeout *HttpTimeouts `hcl:"timeouts,block" toml:"timeouts,block"`
AllowUnprotectedTxs bool `hcl:"unprotectedtxs,optional" toml:"unprotectedtxs,optional"`
AllowUnprotectedTxs bool `hcl:"allow-unprotected-txs,optional" toml:"allow-unprotected-txs,optional"`
}
type GRPCConfig struct {