mirror of https://github.com/nucypher/nucypher.git
annotates rpc calls
parent
96cac14fd5
commit
cdea26074d
|
@ -478,12 +478,19 @@ class Operator(BaseActor):
|
|||
f"{self.transacting_power.account[:8]} performing round 2 of DKG ritual #{ritual_id} from blocktime {timestamp}"
|
||||
)
|
||||
|
||||
ritual = self.coordinator_agent.get_ritual(ritual_id, transcripts=True)
|
||||
missing = sum(1 for t in ritual.transcripts if not t)
|
||||
if missing:
|
||||
raise self.ActorError(
|
||||
f"ritual #{ritual_id} is missing transcripts from {missing} nodes."
|
||||
ritual = self.coordinator_agent.get_ritual(
|
||||
ritual_id, transcripts=True
|
||||
) # n + 2 rpc calls
|
||||
missing_transcripts = sum(1 for t in ritual.transcripts if not t)
|
||||
if missing_transcripts:
|
||||
# Nodes should not be able to aggregate transcripts until all transcripts
|
||||
# have been posted. If this happens, it's a bug.
|
||||
message = (
|
||||
f"Aggregation is not permitted because ritual #{ritual_id} is "
|
||||
f"missing {missing_transcripts} transcripts."
|
||||
)
|
||||
self.log.critical(message)
|
||||
raise self.ActorError(message)
|
||||
|
||||
# Prepare the DKG artifacts
|
||||
validators = self._resolve_validators(ritual, ritual_id)
|
||||
|
|
|
@ -775,13 +775,13 @@ class CoordinatorAgent(EthereumContractAgent):
|
|||
if not participants and transcripts:
|
||||
raise ValueError("Cannot get transcripts without participants")
|
||||
|
||||
ritual = self.rituals(ritual_id) # call 1
|
||||
ritual = self.rituals(ritual_id) # 1 rpc call
|
||||
if not participants:
|
||||
return ritual
|
||||
|
||||
participants = []
|
||||
addresses = self.get_providers(ritual_id) # call 2
|
||||
for index, address in enumerate(addresses): # n calls
|
||||
addresses = self.get_providers(ritual_id) # 1 rpc call
|
||||
for index, address in enumerate(addresses): # n rpc calls
|
||||
participant = self.get_participant(ritual_id, address, transcripts)
|
||||
participants.append(participant)
|
||||
ritual.participants = participants
|
||||
|
|
Loading…
Reference in New Issue