Skip to content

Commit

Permalink
Make support for non-EIP-155 txs over RPC optional
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Aug 22, 2023
1 parent f96dcca commit 370e1a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arbitrum/apibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (a *APIBackend) RPCEVMTimeout() time.Duration {
}

func (a *APIBackend) UnprotectedAllowed() bool {
return true // TODO: is that true?
return a.b.config.TxAllowUnprotected
}

// Blockchain API
Expand Down
8 changes: 6 additions & 2 deletions arbitrum/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type Config struct {
// send-transction variants. The unit is ether.
RPCTxFeeCap float64 `koanf:"tx-fee-cap"`

TxAllowUnprotected bool `koanf:"tx-allow-unprotected"`

// RPCEVMTimeout is the global timeout for eth-call.
RPCEVMTimeout time.Duration `koanf:"evm-timeout"`

Expand Down Expand Up @@ -45,6 +47,7 @@ type ArbDebugConfig struct {
func ConfigAddOptions(prefix string, f *flag.FlagSet) {
f.Uint64(prefix+".gas-cap", DefaultConfig.RPCGasCap, "cap on computation gas that can be used in eth_call/estimateGas (0=infinite)")
f.Float64(prefix+".tx-fee-cap", DefaultConfig.RPCTxFeeCap, "cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)")
f.Bool(prefix+".tx-allow-unprotected", DefaultConfig.TxAllowUnprotected, "allow transactions that aren't EIP-155 replay protected to be submitted over the RPC")
f.Duration(prefix+".evm-timeout", DefaultConfig.RPCEVMTimeout, "timeout used for eth_call (0=infinite)")
f.Uint64(prefix+".bloom-bits-blocks", DefaultConfig.BloomBitsBlocks, "number of blocks a single bloom bit section vector holds")
f.Uint64(prefix+".bloom-confirms", DefaultConfig.BloomConfirms, "number of confirmation blocks before a bloom section is considered final")
Expand All @@ -67,8 +70,9 @@ const (
)

var DefaultConfig = Config{
RPCGasCap: ethconfig.Defaults.RPCGasCap, // 50,000,000
RPCTxFeeCap: ethconfig.Defaults.RPCTxFeeCap, // 1 ether
RPCGasCap: ethconfig.Defaults.RPCGasCap, // 50,000,000
RPCTxFeeCap: ethconfig.Defaults.RPCTxFeeCap, // 1 ether
TxAllowUnprotected: true,
RPCEVMTimeout: ethconfig.Defaults.RPCEVMTimeout, // 5 seconds
BloomBitsBlocks: params.BloomBitsBlocks * 4, // we generally have smaller blocks
BloomConfirms: params.BloomConfirms,
Expand Down

0 comments on commit 370e1a4

Please sign in to comment.