proto: adjust max_tx_fee values for all supported coins
Set these low enough to avoid significant loss but high enough so they’ll be exceeded only in rare situations (i.e. abnormally large network fees and/or transaction sizes).
This commit is contained in:
parent
9cefb4ce40
commit
43389dd0d9
9 changed files with 41 additions and 14 deletions
|
|
@ -143,19 +143,22 @@
|
|||
# bch_cashaddr true
|
||||
|
||||
# Set the maximum transaction fee for BTC:
|
||||
# btc_max_tx_fee 0.003
|
||||
# btc_max_tx_fee 0.001
|
||||
|
||||
# Set the maximum transaction fee for BCH:
|
||||
# bch_max_tx_fee 0.1
|
||||
# bch_max_tx_fee 0.2
|
||||
|
||||
# Set the maximum transaction fee for LTC:
|
||||
# ltc_max_tx_fee 0.3
|
||||
# ltc_max_tx_fee 1.0
|
||||
|
||||
# Set the maximum transaction fee for ETH:
|
||||
# eth_max_tx_fee 0.005
|
||||
# eth_max_tx_fee 0.02
|
||||
|
||||
# Set the maximum transaction fee for ETC:
|
||||
# etc_max_tx_fee 1.0
|
||||
|
||||
# Set the maximum transaction fee for RUNE:
|
||||
# rune_max_tx_fee 0.2
|
||||
# rune_max_tx_fee 5.0
|
||||
|
||||
# Set the Ethereum mainnet chain names (space-separated list, first is default):
|
||||
# eth_mainnet_chain_names ethereum foundation
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class mainnet(mainnet):
|
|||
]
|
||||
caps = ()
|
||||
coin_amt = 'BCHAmt'
|
||||
max_tx_fee = 0.1
|
||||
max_tx_fee = 0.2
|
||||
max_op_return_data_len = 80
|
||||
cashaddr_pfx = 'bitcoincash'
|
||||
cashaddr = True
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class mainnet(CoinProtocol.Secp256k1): # chainparams.cpp
|
|||
preferred_mmtypes = ('B', 'S', 'C')
|
||||
dfl_mmtype = 'L'
|
||||
coin_amt = 'BTCAmt'
|
||||
max_tx_fee = 0.003
|
||||
max_tx_fee = 0.001
|
||||
has_chg = True
|
||||
sighash_type = 'ALL'
|
||||
block0 = '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from ..eth.params import mainnet
|
|||
|
||||
class mainnet(mainnet):
|
||||
chain_names = ['classic', 'ethereum_classic']
|
||||
max_tx_fee = 0.005
|
||||
max_tx_fee = 1.0
|
||||
coin_amt = 'ETCAmt'
|
||||
|
||||
class testnet(mainnet):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class mainnet(CoinProtocol.DummyWIF, CoinProtocol.Secp256k1):
|
|||
pubkey_type = 'std' # required by DummyWIF
|
||||
|
||||
coin_amt = 'ETHAmt'
|
||||
max_tx_fee = 0.005
|
||||
max_tx_fee = 0.02
|
||||
chain_names = ['ethereum', 'foundation']
|
||||
sign_mode = 'standalone'
|
||||
caps = ('token',)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class mainnet(mainnet):
|
|||
wif_ver_num = {'std': 'b0'}
|
||||
mmtypes = ('L', 'C', 'S', 'B')
|
||||
coin_amt = 'LTCAmt'
|
||||
max_tx_fee = 0.3
|
||||
max_tx_fee = 1.0
|
||||
max_op_return_data_len = 80
|
||||
base_coin = 'LTC'
|
||||
forks = []
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class mainnet(CoinProtocol.Secp256k1):
|
|||
preferred_mmtypes = ('X',)
|
||||
dfl_mmtype = 'X'
|
||||
coin_amt = 'UniAmt'
|
||||
max_tx_fee = 0.2
|
||||
max_tx_fee = 5.0
|
||||
caps = ('refreq')
|
||||
mmcaps = ('tw', 'rpc', 'rpc_init')
|
||||
base_proto = 'THORChain'
|
||||
|
|
|
|||
|
|
@ -370,6 +370,7 @@ class CmdTestAutosignAutomount(CmdTestAutosignThreaded, CmdTestRegtest):
|
|||
sid = self._user_sid('alice')
|
||||
return self._alice_txbump(
|
||||
fee_opt = '--fee=400s',
|
||||
extra_opts = [self.max_tx_fee_opt(0.002)],
|
||||
output_args = ['data:message for posterity', f'{self.burn_addr},7.654321', f'{sid}:C:1'])
|
||||
|
||||
def alice_txbump6(self):
|
||||
|
|
|
|||
|
|
@ -148,6 +148,9 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
('addrgen1',
|
||||
(1, 'address generation', [[['mmdat'], 1]])
|
||||
),
|
||||
('txcreate1_bad',
|
||||
(1, 'transaction creation, ‘max_tx_fee’ exceeded', [[['addrs'], 1]])
|
||||
),
|
||||
('txcreate1',
|
||||
(1, 'transaction creation', [[['addrs'], 1]])
|
||||
),
|
||||
|
|
@ -336,6 +339,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
segwit_do = (
|
||||
'walletgen1',
|
||||
'addrgen1',
|
||||
'txcreate1_bad',
|
||||
'txcreate1',
|
||||
'txbump1',
|
||||
'txsign1',
|
||||
|
|
@ -424,6 +428,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
txfile,
|
||||
save = save,
|
||||
has_label = has_label,
|
||||
extra_opts = [self.max_tx_fee_opt(0.005)],
|
||||
dfl_wallet = True)
|
||||
|
||||
def passchg_dfl_wallet(self, pf):
|
||||
|
|
@ -782,6 +787,19 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
|
||||
return t
|
||||
|
||||
def txcreate1_bad(self, addrfile):
|
||||
if self.coin != 'btc':
|
||||
return 'skip'
|
||||
t = self.txcreate_common(
|
||||
sources = ['1'],
|
||||
add_output_args = ['hexdata:' + 'ee' * self.proto.max_op_return_data_len],
|
||||
exit_val = 1)
|
||||
t.expect('abel:\b', 'q')
|
||||
t.expect('spend: ', '1\n')
|
||||
t.expect('too high')
|
||||
t.expect('fee: ', f'{self.proto.max_tx_fee}\n')
|
||||
return t
|
||||
|
||||
def txcreate1(self, addrfile):
|
||||
return self.txcreate_common(
|
||||
sources = ['1'],
|
||||
|
|
@ -789,7 +807,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
add_output_args = ['hexdata:' + 'ee' * self.proto.max_op_return_data_len])
|
||||
|
||||
def txsign1(self, *args, **kwargs):
|
||||
t = self.txsign(*args, **kwargs)
|
||||
t = self.txsign(*args, extra_opts=[self.max_tx_fee_opt(0.006)], **kwargs)
|
||||
return 'ok' if self.has_segfault_on_exit_bug else t
|
||||
|
||||
def txbump1(self, txfile, prepend_args=[], seed_args=[]):
|
||||
|
|
@ -798,7 +816,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
return 'skip'
|
||||
args = prepend_args + [
|
||||
'--quiet',
|
||||
'--btc-max-tx-fee=0.006',
|
||||
self.max_tx_fee_opt(0.006),
|
||||
'--outdir='+self.tmpdir,
|
||||
txfile
|
||||
] + seed_args
|
||||
|
|
@ -959,6 +977,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
'-d', self.tmpdir,
|
||||
'-p1',
|
||||
'-M', keyaddr_file,
|
||||
self.max_tx_fee_opt(0.006),
|
||||
txfile],
|
||||
no_passthru_opts = ['coin'])
|
||||
t.license()
|
||||
|
|
@ -971,7 +990,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
return self.txcreate_common(
|
||||
sources = ['1'],
|
||||
cmdline_inputs = True,
|
||||
add_opts = ['--yes'])
|
||||
add_opts = ['--yes', self.max_tx_fee_opt(0.002)])
|
||||
|
||||
def walletgen2(self, del_dw_run='dummy'):
|
||||
return self.walletgen1(seed_len=128)
|
||||
|
|
@ -988,6 +1007,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
def txsign2(self, wf1, txf1, wf2, txf2):
|
||||
t = self.spawn('mmgen-txsign', [
|
||||
'-d', self.tmpdir,
|
||||
self.max_tx_fee_opt(0.006),
|
||||
txf1, wf1, txf2, wf2],
|
||||
no_passthru_opts = ['coin'])
|
||||
t.license()
|
||||
|
|
@ -1044,6 +1064,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
def txcreate4(self, f1, f2, f3, f4, f5, f6):
|
||||
return self.txcreate_common(
|
||||
sources = ['1', '2', '3', '4', '14'],
|
||||
add_opts = [self.max_tx_fee_opt(0.002)],
|
||||
non_mmgen_input = '4',
|
||||
do_label = True,
|
||||
view = 'y',
|
||||
|
|
@ -1056,6 +1077,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
'-i', 'brain',
|
||||
'-b' + self.bw_params,
|
||||
'-p1',
|
||||
self.max_tx_fee_opt(0.002),
|
||||
'--keys-from-file=' + non_mm_file,
|
||||
'--mmgen-keys-from-file=' + f6]
|
||||
t = self.spawn('mmgen-txsign', add_opts + [f1, f2, f3, f4, f5], no_passthru_opts=['coin'])
|
||||
|
|
@ -1076,6 +1098,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
'-i', 'brain',
|
||||
'-b'+self.bw_params,
|
||||
'-p1',
|
||||
self.max_tx_fee_opt(0.002),
|
||||
'--keys-from-file=' + non_mm_file,
|
||||
'--mmgen-keys-from-file=' + f12]
|
||||
self.get_file_with_ext('sigtx', delete_all=True) # delete tx signed by txsign4
|
||||
|
|
|
|||
Loading…
Reference in a new issue