Browse Source

add comments for buggy daemons (Litecoin v0.21.2rc5, Geth v1.10.17)

- Litecoin Core v0.21.2rc5 (comment only)
- Geth v1.10.17 (comment + testing code)
The MMGen Project 2 years ago
parent
commit
303027f02f

+ 3 - 0
mmgen/base_proto/bitcoin/daemon.py

@@ -147,6 +147,9 @@ class bitcoin_cash_node_daemon(bitcoin_core_daemon):
 			e.args[0] )
 
 class litecoin_core_daemon(bitcoin_core_daemon):
+	# v0.21.2rc5 crashes when mining more than 431 blocks in regtest mode:
+	#   CreateNewBlock: TestBlockValidity failed: bad-txns-vin-empty, Transaction check failed
+	# daemon_data = _dd('Litecoin Core', 210200, '0.21.2')
 	daemon_data = _dd('Litecoin Core', 180100, '0.18.1')
 	exec_fn = 'litecoind'
 	cli_fn = 'litecoin-cli'

+ 4 - 1
mmgen/base_proto/ethereum/daemon.py

@@ -84,6 +84,8 @@ class parity_daemon(openethereum_daemon):
 	exec_fn = 'parity'
 
 class geth_daemon(ethereum_daemon):
+	# bug in v1.10.17 requires --dev to be omitted to initialize blockchain (devnet_init_bug)
+	# daemon_data = _dd('Geth', 1010017, '1.10.17')
 	daemon_data = _dd('Geth', 1010014, '1.10.14')
 	version_pat = r'Geth/v(\d+)\.(\d+)\.(\d+)'
 	exec_fn = 'geth'
@@ -93,6 +95,7 @@ class geth_daemon(ethereum_daemon):
 		'linux': [g.home_dir,'.ethereum','geth'],
 		'win':   [os.getenv('LOCALAPPDATA'),'Geth'] # FIXME
 	}
+	avail_opts = ('no_daemonize','online','devnet_init_bug')
 
 	def init_subclass(self):
 		self.coind_args = list_gen(
@@ -104,7 +107,7 @@ class geth_daemon(ethereum_daemon):
 			['--maxpeers=0', not self.opt.online],
 			[f'--datadir={self.datadir}', self.non_dfl_datadir],
 			['--goerli', self.network=='testnet'],
-			['--dev', self.network=='regtest'],
+			['--dev', self.network=='regtest' and not self.opt.devnet_init_bug],
 		)
 
 # https://github.com/ledgerwatch/erigon

+ 14 - 0
test/test_py_d/ts_ethdev.py

@@ -343,6 +343,19 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 	async def setup(self):
 		self.spawn('',msg_only=True)
 
+		async def geth_devnet_init_bug_workaround(): # devnet_init_bug
+			from mmgen.daemon import CoinDaemon
+			d = CoinDaemon(
+				self.proto.coin+'_rt',
+				test_suite = True,
+				daemon_id  = g.daemon_id,
+				opts       = ['devnet_init_bug'] )
+			d.start()
+			import asyncio
+			await asyncio.sleep(1)
+			d.stop()
+			await asyncio.sleep(1)
+
 		if not self.using_solc:
 			srcdir = os.path.join(self.tr.repo_root,'test','ref','ethereum','bin')
 			from shutil import copytree
@@ -353,6 +366,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared):
 			if g.daemon_id == 'geth':
 				self.geth_setup()
 				set_vt100()
+				# await geth_devnet_init_bug_workaround() # uncomment to enable testing with v1.10.17
 			if not start_test_daemons(
 					self.proto.coin+'_rt',
 					remove_datadir = not g.daemon_id in ('geth','erigon') ):