From 2ad6dcf53b14f3c1a7184533a4425b866a38295b Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Fri, 20 Jan 2023 17:13:36 +0530 Subject: [PATCH 1/4] consensus/bor : add : devFakeAuthor flag --- consensus/bor/bor.go | 18 +++++++++++++++++- consensus/bor/valset/validator_set.go | 19 ++++++++++--------- eth/ethconfig/config.go | 10 ++++++++-- internal/cli/server/config.go | 7 +++++++ internal/cli/server/flags.go | 6 ++++++ miner/fake_miner.go | 2 +- 6 files changed, 49 insertions(+), 13 deletions(-) diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index b6d643eeba..a920a1992d 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -227,7 +227,8 @@ type Bor struct { HeimdallClient IHeimdallClient // The fields below are for testing only - fakeDiff bool // Skip difficulty verifications + fakeDiff bool // Skip difficulty verifications + devFakeAuthor bool closeOnce sync.Once } @@ -245,6 +246,7 @@ func New( spanner Spanner, heimdallClient IHeimdallClient, genesisContracts GenesisContract, + devFakeAuthor bool, ) *Bor { // get bor config borConfig := chainConfig.Bor @@ -267,6 +269,7 @@ func New( spanner: spanner, GenesisContractsClient: genesisContracts, HeimdallClient: heimdallClient, + devFakeAuthor: devFakeAuthor, } c.authorizedSigner.Store(&signer{ @@ -480,6 +483,19 @@ func (c *Bor) verifyCascadingFields(chain consensus.ChainHeaderReader, header *t // nolint: gocognit func (c *Bor) snapshot(chain consensus.ChainHeaderReader, number uint64, hash common.Hash, parents []*types.Header) (*Snapshot, error) { // Search for a snapshot in memory or on disk for checkpoints + + signer := common.BytesToAddress(c.authorizedSigner.Load().signer.Bytes()) + if c.devFakeAuthor && signer.String() != "0x0000000000000000000000000000000000000000" { + log.Info("👨‍💻Using DevFakeAuthor", "signer", signer) + + val := valset.NewValidator(signer, 1000) + validatorset := valset.NewValidatorSet([]*valset.Validator{val}) + + snapshot := newSnapshot(c.config, c.signatures, number, hash, validatorset.Validators) + + return snapshot, nil + } + var snap *Snapshot headers := make([]*types.Header, 0, 16) diff --git a/consensus/bor/valset/validator_set.go b/consensus/bor/valset/validator_set.go index 0a6f7c4487..bfe177e2f8 100644 --- a/consensus/bor/valset/validator_set.go +++ b/consensus/bor/valset/validator_set.go @@ -305,7 +305,7 @@ func (vals *ValidatorSet) UpdateTotalVotingPower() error { // It recomputes the total voting power if required. func (vals *ValidatorSet) TotalVotingPower() int64 { if vals.totalVotingPower == 0 { - log.Info("invoking updateTotalVotingPower before returning it") + log.Debug("invoking updateTotalVotingPower before returning it") if err := vals.UpdateTotalVotingPower(); err != nil { // Can/should we do better? @@ -641,14 +641,15 @@ func (vals *ValidatorSet) UpdateValidatorMap() { // UpdateWithChangeSet attempts to update the validator set with 'changes'. // It performs the following steps: -// - validates the changes making sure there are no duplicates and splits them in updates and deletes -// - verifies that applying the changes will not result in errors -// - computes the total voting power BEFORE removals to ensure that in the next steps the priorities -// across old and newly added validators are fair -// - computes the priorities of new validators against the final set -// - applies the updates against the validator set -// - applies the removals against the validator set -// - performs scaling and centering of priority values +// - validates the changes making sure there are no duplicates and splits them in updates and deletes +// - verifies that applying the changes will not result in errors +// - computes the total voting power BEFORE removals to ensure that in the next steps the priorities +// across old and newly added validators are fair +// - computes the priorities of new validators against the final set +// - applies the updates against the validator set +// - applies the removals against the validator set +// - performs scaling and centering of priority values +// // If an error is detected during verification steps, it is returned and the validator set // is not changed. func (vals *ValidatorSet) UpdateWithChangeSet(changes []*Validator) error { diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 1265a67703..68fe9e9997 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -235,6 +235,9 @@ type Config struct { // OverrideTerminalTotalDifficulty (TODO: remove after the fork) OverrideTerminalTotalDifficulty *big.Int `toml:",omitempty"` + + // Develop Fake Author mode to produce blocks without authorisation + DevFakeAuthor bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"` } // CreateConsensusEngine creates a consensus engine for the given chain configuration. @@ -255,8 +258,11 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, et spanner := span.NewChainSpanner(blockchainAPI, contract.ValidatorSet(), chainConfig, common.HexToAddress(chainConfig.Bor.ValidatorContract)) if ethConfig.WithoutHeimdall { - return bor.New(chainConfig, db, blockchainAPI, spanner, nil, genesisContractsClient) + return bor.New(chainConfig, db, blockchainAPI, spanner, nil, genesisContractsClient, ethConfig.DevFakeAuthor) } else { + if ethConfig.DevFakeAuthor { + log.Warn("Sanitizing DevFakeAuthor", "Use DevFakeAuthor with", "--bor.withoutheimdall") + } var heimdallClient bor.IHeimdallClient if ethConfig.HeimdallgRPCAddress != "" { heimdallClient = heimdallgrpc.NewHeimdallGRPCClient(ethConfig.HeimdallgRPCAddress) @@ -264,7 +270,7 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, et heimdallClient = heimdall.NewHeimdallClient(ethConfig.HeimdallURL) } - return bor.New(chainConfig, db, blockchainAPI, spanner, heimdallClient, genesisContractsClient) + return bor.New(chainConfig, db, blockchainAPI, spanner, heimdallClient, genesisContractsClient, false) } } else { switch config.PowMode { diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 52461d9306..ce56107778 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -108,6 +108,9 @@ type Config struct { // Developer has the developer mode related settings Developer *DeveloperConfig `hcl:"developer,block" toml:"developer,block"` + + // Develop Fake Author mode to produce blocks without authorisation + DevFakeAuthor bool `hcl:"devfakeauthor,optional" toml:"devfakeauthor,optional"` } type P2PConfig struct { @@ -580,6 +583,7 @@ func DefaultConfig() *Config { Enabled: false, Period: 0, }, + DevFakeAuthor: false, } } @@ -713,6 +717,9 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (* n.RunHeimdall = c.Heimdall.RunHeimdall n.RunHeimdallArgs = c.Heimdall.RunHeimdallArgs + // Developer Fake Author for producing blocks without authorisation on bor consensus + n.DevFakeAuthor = c.DevFakeAuthor + // gas price oracle { n.GPO.Blocks = int(c.Gpo.Blocks) diff --git a/internal/cli/server/flags.go b/internal/cli/server/flags.go index e52077da97..19792a7bb1 100644 --- a/internal/cli/server/flags.go +++ b/internal/cli/server/flags.go @@ -95,6 +95,12 @@ func (c *Command) Flags() *flagset.Flagset { Value: &c.cliConfig.Heimdall.Without, Default: c.cliConfig.Heimdall.Without, }) + f.BoolFlag(&flagset.BoolFlag{ + Name: "bor.devfakeauthor", + Usage: "Run miner without validator set authorization [dev mode] : Use with '--bor.withoutheimdall'", + Value: &c.cliConfig.DevFakeAuthor, + Default: c.cliConfig.DevFakeAuthor, + }) f.StringFlag(&flagset.StringFlag{ Name: "bor.heimdallgRPC", Usage: "Address of Heimdall gRPC service", diff --git a/miner/fake_miner.go b/miner/fake_miner.go index 3ca2f5be77..a09d868b26 100644 --- a/miner/fake_miner.go +++ b/miner/fake_miner.go @@ -152,7 +152,7 @@ func NewFakeBor(t TensingObject, chainDB ethdb.Database, chainConfig *params.Cha chainConfig.Bor = params.BorUnittestChainConfig.Bor } - return bor.New(chainConfig, chainDB, ethAPIMock, spanner, heimdallClientMock, contractMock) + return bor.New(chainConfig, chainDB, ethAPIMock, spanner, heimdallClientMock, contractMock, false) } type mockBackend struct { From cb973283bcdc22429425b1ac3678f1815966a7c0 Mon Sep 17 00:00:00 2001 From: Raneet Debnath Date: Fri, 27 Jan 2023 16:05:37 +0530 Subject: [PATCH 2/4] core,eth,internal/cli,internal/ethapi: add --rpc.allow-unprotected-txs flag to allow txs to get replayed (for shadow node) --- core/tx_pool.go | 20 +++++++++++++---- core/types/transaction_signing.go | 36 +++++++++++++++++++++++++++++++ eth/backend.go | 4 +++- internal/cli/server/config.go | 12 +++++++---- internal/cli/server/flags.go | 7 ++++++ internal/ethapi/api.go | 7 +++++- 6 files changed, 76 insertions(+), 10 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index e98fd2e0ae..28a2c5bfb2 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -174,7 +174,8 @@ type TxPoolConfig struct { AccountQueue uint64 // Maximum number of non-executable transaction slots permitted per account GlobalQueue uint64 // Maximum number of non-executable transaction slots for all accounts - Lifetime time.Duration // Maximum amount of time non-executable transaction are queued + Lifetime time.Duration // Maximum amount of time non-executable transaction are queued + AllowUnprotectedTxs bool // Allow non-EIP-155 transactions } // DefaultTxPoolConfig contains the default configurations for the transaction @@ -191,7 +192,8 @@ var DefaultTxPoolConfig = TxPoolConfig{ AccountQueue: 64, GlobalQueue: 1024, - Lifetime: 3 * time.Hour, + Lifetime: 3 * time.Hour, + AllowUnprotectedTxs: false, } // sanitize checks the provided user configurations and changes anything that's @@ -759,7 +761,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { // Make sure the transaction is signed properly. from, err := types.Sender(pool.signer, tx) - if err != nil { + if err != nil && !pool.config.AllowUnprotectedTxs { return ErrInvalidSender } @@ -1096,6 +1098,11 @@ func (pool *TxPool) addTxs(txs []*types.Transaction, local, sync bool) []error { // Exclude transactions with invalid signatures as soon as // possible and cache senders in transactions before // obtaining lock + + if pool.config.AllowUnprotectedTxs { + pool.signer = types.NewFakeSigner(tx.ChainId()) + } + _, err = types.Sender(pool.signer, tx) if err != nil { errs = append(errs, ErrInvalidSender) @@ -1149,11 +1156,16 @@ func (pool *TxPool) addTx(tx *types.Transaction, local, sync bool) error { // Exclude transactions with invalid signatures as soon as // possible and cache senders in transactions before // obtaining lock + if pool.config.AllowUnprotectedTxs { + pool.signer = types.NewFakeSigner(tx.ChainId()) + } + _, err = types.Sender(pool.signer, tx) if err != nil { invalidTxMeter.Mark(1) - return + } else { + err = nil } }() diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 959aba637a..8f3fd7a4c7 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -470,6 +470,42 @@ func (fs FrontierSigner) Hash(tx *Transaction) common.Hash { }) } +// FakeSigner implements the Signer interface and accepts unprotected transactions +type FakeSigner struct{ londonSigner } + +var _ Signer = FakeSigner{} + +func NewFakeSigner(chainId *big.Int) Signer { + signer := NewLondonSigner(chainId) + ls, _ := signer.(londonSigner) + + return FakeSigner{londonSigner: ls} +} + +func (f FakeSigner) Sender(tx *Transaction) (common.Address, error) { + return f.londonSigner.Sender(tx) +} + +func (f FakeSigner) SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error) { + return f.londonSigner.SignatureValues(tx, sig) +} + +func (f FakeSigner) ChainID() *big.Int { + return f.londonSigner.ChainID() +} + +// Hash returns 'signature hash', i.e. the transaction hash that is signed by the +// private key. This hash does not uniquely identify the transaction. +func (f FakeSigner) Hash(tx *Transaction) common.Hash { + return f.londonSigner.Hash(tx) +} + +// Equal returns true if the given signer is the same as the receiver. +func (f FakeSigner) Equal(Signer) bool { + // Always return true + return true +} + func decodeSignature(sig []byte) (r, s, v *big.Int) { if len(sig) != crypto.SignatureLength { panic(fmt.Sprintf("wrong size for signature: got %d, want %d", len(sig), crypto.SignatureLength)) diff --git a/eth/backend.go b/eth/backend.go index 824fec8914..869566a7ac 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -174,7 +174,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { // START: Bor changes eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil} if eth.APIBackend.allowUnprotectedTxs { - log.Info("Unprotected transactions allowed") + log.Debug(" ###########", "Unprotected transactions allowed") + + config.TxPool.AllowUnprotectedTxs = true } gpoParams := config.GPO if gpoParams.Default == nil { diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index ce56107778..67780c9423 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -254,6 +254,8 @@ type JsonRPCConfig struct { Graphql *APIConfig `hcl:"graphql,block" toml:"graphql,block"` HttpTimeout *HttpTimeouts `hcl:"timeouts,block" toml:"timeouts,block"` + + AllowUnprotectedTxs bool `hcl:"unprotectedtxs,optional" toml:"unprotectedtxs,optional"` } type GRPCConfig struct { @@ -504,10 +506,11 @@ func DefaultConfig() *Config { IgnorePrice: gasprice.DefaultIgnorePrice, }, JsonRPC: &JsonRPCConfig{ - IPCDisable: false, - IPCPath: "", - GasCap: ethconfig.Defaults.RPCGasCap, - TxFeeCap: ethconfig.Defaults.RPCTxFeeCap, + IPCDisable: false, + IPCPath: "", + GasCap: ethconfig.Defaults.RPCGasCap, + TxFeeCap: ethconfig.Defaults.RPCTxFeeCap, + AllowUnprotectedTxs: false, Http: &APIConfig{ Enabled: false, Port: 8545, @@ -1049,6 +1052,7 @@ func (c *Config) buildNode() (*node.Config, error) { InsecureUnlockAllowed: c.Accounts.AllowInsecureUnlock, Version: params.VersionWithCommit(gitCommit, gitDate), IPCPath: ipcPath, + AllowUnprotectedTxs: c.JsonRPC.AllowUnprotectedTxs, P2P: p2p.Config{ MaxPeers: int(c.P2P.MaxPeers), MaxPendingPeers: int(c.P2P.MaxPendPeers), diff --git a/internal/cli/server/flags.go b/internal/cli/server/flags.go index 19792a7bb1..a0fad2465d 100644 --- a/internal/cli/server/flags.go +++ b/internal/cli/server/flags.go @@ -364,6 +364,13 @@ func (c *Command) Flags() *flagset.Flagset { Default: c.cliConfig.JsonRPC.TxFeeCap, Group: "JsonRPC", }) + f.BoolFlag(&flagset.BoolFlag{ + Name: "rpc.allow-unprotected-txs", + Usage: "Allow for unprotected (non EIP155 signed) transactions to be submitted via RPC", + Value: &c.cliConfig.JsonRPC.AllowUnprotectedTxs, + Default: c.cliConfig.JsonRPC.AllowUnprotectedTxs, + Group: "JsonRPC", + }) f.BoolFlag(&flagset.BoolFlag{ Name: "ipcdisable", Usage: "Disable the IPC-RPC server", diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 7df46b1f33..0f8494674f 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1856,7 +1856,8 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c // Print a log with full tx details for manual investigations and interventions signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Number()) from, err := types.Sender(signer, tx) - if err != nil { + + if err != nil && (!b.UnprotectedAllowed() || (b.UnprotectedAllowed() && err != types.ErrInvalidChainId)) { return common.Hash{}, err } @@ -2046,6 +2047,10 @@ func (s *PublicTransactionPoolAPI) Resend(ctx context.Context, sendArgs Transact for _, p := range pending { wantSigHash := s.signer.Hash(matchTx) pFrom, err := types.Sender(s.signer, p) + + if err != nil && (s.b.UnprotectedAllowed() && err == types.ErrInvalidChainId) { + err = nil + } if err == nil && pFrom == sendArgs.from() && s.signer.Hash(p) == wantSigHash { // Match. Re-sign and send the transaction. if gasPrice != nil && (*big.Int)(gasPrice).Sign() != 0 { From 2c35dcc5bbcb748534087bbee56a318ee30d86f7 Mon Sep 17 00:00:00 2001 From: Raneet Debnath Date: Wed, 15 Feb 2023 20:06:15 +0530 Subject: [PATCH 3/4] core,docs/cli,internal/cli/server: make docs --- core/tx_pool_test.go | 47 +++++++++++++++++++++++++++++++++++ docs/cli/server.md | 8 ++++++ internal/cli/server/config.go | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 63f712bb9c..b7893f2f8b 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -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. // diff --git a/docs/cli/server.md b/docs/cli/server.md index 5bc0ff1024..f90e971b6c 100644 --- a/docs/cli/server.md +++ b/docs/cli/server.md @@ -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) diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 67780c9423..980548c529 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -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 { From 4917fde5be2a8c1eb5f6147b1900d52cefcd7dbd Mon Sep 17 00:00:00 2001 From: Raneet Debnath Date: Thu, 16 Feb 2023 09:59:22 +0530 Subject: [PATCH 4/4] builder,docs/cli,packaging: update toml files --- builder/files/config.toml | 3 ++- docs/cli/example_config.toml | 2 ++ packaging/templates/mainnet-v1/archive/config.toml | 2 ++ packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml | 2 ++ .../templates/mainnet-v1/sentry/validator/bor/config.toml | 2 ++ packaging/templates/mainnet-v1/without-sentry/bor/config.toml | 2 ++ packaging/templates/testnet-v4/archive/config.toml | 2 ++ packaging/templates/testnet-v4/sentry/sentry/bor/config.toml | 2 ++ .../templates/testnet-v4/sentry/validator/bor/config.toml | 2 ++ packaging/templates/testnet-v4/without-sentry/bor/config.toml | 2 ++ 10 files changed, 20 insertions(+), 1 deletion(-) diff --git a/builder/files/config.toml b/builder/files/config.toml index 0f2919807f..a59d986903 100644 --- a/builder/files/config.toml +++ b/builder/files/config.toml @@ -13,7 +13,7 @@ syncmode = "full" # snapshot = true # "bor.logs" = false # ethstats = "" - +# devfakeauthor = false # ["eth.requiredblocks"] [p2p] @@ -65,6 +65,7 @@ syncmode = "full" # ipcpath = "" # gascap = 50000000 # txfeecap = 5.0 +# allow-unprotected-txs = false # [jsonrpc.http] # enabled = false # port = 8545 diff --git a/docs/cli/example_config.toml b/docs/cli/example_config.toml index 64ef60ae12..449f545990 100644 --- a/docs/cli/example_config.toml +++ b/docs/cli/example_config.toml @@ -13,6 +13,7 @@ gcmode = "full" # Blockchain garbage collection mode ("full", "arch snapshot = true # Enables the snapshot-database mode "bor.logs" = false # Enables bor log retrieval ethstats = "" # Reporting URL of a ethstats service (nodename:secret@host:port) +devfakeauthor = false # Run miner without validator set authorization [dev mode] : Use with '--bor.withoutheimdall' (default: false) ["eth.requiredblocks"] # Comma separated block number-to-hash mappings to require for peering (=) (default = empty map) "31000000" = "0x2087b9e2b353209c2c21e370c82daa12278efd0fe5f0febe6c29035352cf050e" @@ -64,6 +65,7 @@ ethstats = "" # Reporting URL of a ethstats service (nodename:sec ipcpath = "" # Filename for IPC socket/pipe within the datadir (explicit paths escape it) gascap = 50000000 # Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite) txfeecap = 5.0 # Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) + allow-unprotected-txs = false # Allow for unprotected (non EIP155 signed) transactions to be submitted via RPC (default: false) [jsonrpc.http] enabled = false # Enable the HTTP-RPC server port = 8545 # http.port diff --git a/packaging/templates/mainnet-v1/archive/config.toml b/packaging/templates/mainnet-v1/archive/config.toml index 9eaafd3bee..d69b044043 100644 --- a/packaging/templates/mainnet-v1/archive/config.toml +++ b/packaging/templates/mainnet-v1/archive/config.toml @@ -8,6 +8,7 @@ syncmode = "full" gcmode = "archive" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -57,6 +58,7 @@ gcmode = "archive" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml index 94dd6634f0..873a6b7390 100644 --- a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml @@ -8,6 +8,7 @@ syncmode = "full" # gcmode = "full" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -57,6 +58,7 @@ syncmode = "full" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml index 9c55683c96..00891a80ba 100644 --- a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml @@ -10,6 +10,7 @@ syncmode = "full" # gcmode = "full" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -59,6 +60,7 @@ syncmode = "full" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml index 573f1f3be8..7cdcb55095 100644 --- a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml @@ -10,6 +10,7 @@ syncmode = "full" # gcmode = "full" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -59,6 +60,7 @@ syncmode = "full" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/testnet-v4/archive/config.toml b/packaging/templates/testnet-v4/archive/config.toml index 1762fdf117..871a3e526b 100644 --- a/packaging/templates/testnet-v4/archive/config.toml +++ b/packaging/templates/testnet-v4/archive/config.toml @@ -8,6 +8,7 @@ syncmode = "full" gcmode = "archive" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -57,6 +58,7 @@ gcmode = "archive" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml index ae191cec2c..2a63a8b4a1 100644 --- a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml @@ -8,6 +8,7 @@ syncmode = "full" # gcmode = "full" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -57,6 +58,7 @@ syncmode = "full" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml index b441cc137d..bc72044730 100644 --- a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml @@ -10,6 +10,7 @@ syncmode = "full" # gcmode = "full" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -59,6 +60,7 @@ syncmode = "full" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545 diff --git a/packaging/templates/testnet-v4/without-sentry/bor/config.toml b/packaging/templates/testnet-v4/without-sentry/bor/config.toml index 05a254e184..531c346735 100644 --- a/packaging/templates/testnet-v4/without-sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/without-sentry/bor/config.toml @@ -10,6 +10,7 @@ syncmode = "full" # gcmode = "full" # snapshot = true # ethstats = "" +# devfakeauthor = false # ["eth.requiredblocks"] @@ -59,6 +60,7 @@ syncmode = "full" # ipcdisable = false # gascap = 50000000 # txfeecap = 5.0 + # allow-unprotected-txs = false [jsonrpc.http] enabled = true port = 8545