Skip to content

Commit

Permalink
GH-1512 Fix to handle bios and isProducer correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Feb 6, 2024
1 parent 22086f6 commit 902c4c9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/TestHarness/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ def connectGroup(group, producerNodes, bridgeNodes) :
Path(instance.config_dir_name), eosdcmd, unstarted=instance.dont_start,
launch_time=launcher.launch_time, walletMgr=self.walletMgr, nodeosVers=self.nodeosVers)
node.keys = instance.keys
node.isProducer = len(instance.producers) > 0
if nodeNum == Node.biosNodeId:
self.biosNode = node
else:
Expand Down Expand Up @@ -1000,7 +1001,9 @@ def activateInstantFinality(self, biosFinalizer=True):
for n in (self.nodes + [self.biosNode]):
if not n or not n.keys or not n.keys[0].blspubkey:
continue
if n.nodeId == Node.biosNodeId and not biosFinalizer:
if not n.isProducer:
continue
if n.nodeId == 'bios' and not biosFinalizer:
continue
numFins = numFins + 1

Expand All @@ -1016,7 +1019,9 @@ def activateInstantFinality(self, biosFinalizer=True):
for n in (self.nodes + [self.biosNode]):
if not n or not n.keys or not n.keys[0].blspubkey:
continue
if n.nodeId == Node.biosNodeId and not biosFinalizer:
if not n.isProducer:
continue
if n.nodeId == 'bios' and not biosFinalizer:
continue
setFinStr += f' {{"description": "finalizer #{finNum}", '
setFinStr += f' "weight":1, '
Expand Down Expand Up @@ -1105,7 +1110,7 @@ def bootstrap(self, launcher, biosNode, totalNodes, prodCount, totalProducers,
return None

if activateIF:
self.activateInstantFinality(biosFinalizer)
self.activateInstantFinality(biosFinalizer=biosFinalizer)

Utils.Print("Creating accounts: %s " % ", ".join(producerKeys.keys()))
producerKeys.pop(eosioName)
Expand Down Expand Up @@ -1204,7 +1209,7 @@ def createSystemAccount(accountName):
#
# Could activate instant finality here, but have to wait for finality which with all the producers takes a long time
# if activateIF:
# self.activateInstantFinality(launcher)
# self.activateInstantFinality()

eosioTokenAccount = copy.deepcopy(eosioAccount)
eosioTokenAccount.name = 'eosio.token'
Expand Down

0 comments on commit 902c4c9

Please sign in to comment.