Skip to content

packages.valory.skills.transaction_settlement_abci.rounds

This module contains the data classes for the transaction settlement ABCI application.

Event Objects

class Event(Enum)

Event enumeration for the price estimation demo.

SynchronizedData Objects

class SynchronizedData(BaseSynchronizedData)

Class to represent the synchronized data.

This data is replicated by the tendermint application.

participant_to_signature

@property
def participant_to_signature() -> Mapping[str, SignaturePayload]

Get the participant_to_signature.

tx_hashes_history

@property
def tx_hashes_history() -> List[str]

Get the current cycle's tx hashes history, which has not yet been verified.

keepers

@property
def keepers() -> Deque[str]

Get the current cycle's keepers who have tried to submit a transaction.

keepers_threshold_exceeded

@property
def keepers_threshold_exceeded() -> bool

Check if the number of selected keepers has exceeded the allowed limit.

most_voted_randomness_round

@property
def most_voted_randomness_round() -> int

Get the first in priority keeper to try to re-submit a transaction.

most_voted_keeper_address

@property
def most_voted_keeper_address() -> str

Get the first in priority keeper to try to re-submit a transaction.

is_keeper_set

@property
def is_keeper_set() -> bool

Check whether keeper is set.

keeper_retries

@property
def keeper_retries() -> int

Get the number of times the current keeper has retried.

to_be_validated_tx_hash

@property
def to_be_validated_tx_hash() -> str

Get the tx hash which is ready for validation.

This will always be the last hash in the tx_hashes_history, due to the way we are inserting the hashes in the array. We keep the hashes sorted by the time of their finalization. If this property is accessed before the finalization succeeds, then it is incorrectly used and raises an error.

Returns:

the tx hash which is ready for validation.

final_tx_hash

@property
def final_tx_hash() -> str

Get the verified tx hash.

final_verification_status

@property
def final_verification_status() -> VerificationStatus

Get the final verification status.

most_voted_tx_hash

@property
def most_voted_tx_hash() -> str

Get the most_voted_tx_hash.

missed_messages

@property
def missed_messages() -> Dict[str, int]

The number of missed messages per agent address.

n_missed_messages

@property
def n_missed_messages() -> int

The number of missed messages in total.

should_check_late_messages

@property
def should_check_late_messages() -> bool

Check if we should check for late-arriving messages.

late_arriving_tx_hashes

@property
def late_arriving_tx_hashes() -> Dict[str, List[str]]

Get the late_arriving_tx_hashes.

suspects

@property
def suspects() -> Tuple[str]

Get the suspect agents.

most_voted_check_result

@property
def most_voted_check_result() -> str

Get the most voted checked result.

participant_to_check

@property
def participant_to_check() -> Mapping[str, CheckTransactionHistoryPayload]

Get the mapping from participants to checks.

participant_to_late_messages

@property
def participant_to_late_messages(
) -> Mapping[str, SynchronizeLateMessagesPayload]

Get the mapping from participants to checks.

get_chain_id

def get_chain_id(default_chain_id: str) -> str

Get the chain id.

FailedRound Objects

class FailedRound(DegenerateRound, ABC)

A round that represents that the period failed

CollectSignatureRound Objects

class CollectSignatureRound(CollectDifferentUntilThresholdRound)

A round in which agents sign the transaction

FinalizationRound Objects

class FinalizationRound(OnlyKeeperSendsRound)

A round that represents transaction signing has finished

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

Process the end of the block.

RandomnessTransactionSubmissionRound Objects

class RandomnessTransactionSubmissionRound(CollectSameUntilThresholdRound)

A round for generating randomness

SelectKeeperTransactionSubmissionARound Objects

class SelectKeeperTransactionSubmissionARound(CollectSameUntilThresholdRound)

A round in which a keeper is selected for transaction submission

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

Process the end of the block.

SelectKeeperTransactionSubmissionBRound Objects

class SelectKeeperTransactionSubmissionBRound(
        SelectKeeperTransactionSubmissionARound)

A round in which a new keeper is selected for transaction submission

SelectKeeperTransactionSubmissionBAfterTimeoutRound Objects

class SelectKeeperTransactionSubmissionBAfterTimeoutRound(
        SelectKeeperTransactionSubmissionBRound)

A round in which a new keeper is selected for tx submission after a round timeout of the previous keeper

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

Process the end of the block.

ValidateTransactionRound Objects

class ValidateTransactionRound(VotingRound)

A round in which agents validate the transaction

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

Process the end of the block.

CheckTransactionHistoryRound Objects

class CheckTransactionHistoryRound(CollectSameUntilThresholdRound)

A round in which agents check the transaction history to see if any previous tx has been validated

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

Process the end of the block.

CheckLateTxHashesRound Objects

class CheckLateTxHashesRound(CheckTransactionHistoryRound)

A round in which agents check the late-arriving transaction hashes to see if any of them has been validated

SynchronizeLateMessagesRound Objects

class SynchronizeLateMessagesRound(CollectNonEmptyUntilThresholdRound)

A round in which agents synchronize potentially late arriving messages

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Event]]

Process the end of the block.

process_payload

def process_payload(payload: BaseTxPayload) -> None

Process payload.

check_payload

def check_payload(payload: BaseTxPayload) -> None

Check Payload

FinishedTransactionSubmissionRound Objects

class FinishedTransactionSubmissionRound(DegenerateRound, ABC)

A round that represents the transition to the ResetAndPauseRound

ResetRound Objects

class ResetRound(CollectSameUntilThresholdRound)

A round that represents the reset of a period

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Event]]

Process the end of the block.

TransactionSubmissionAbciApp Objects

class TransactionSubmissionAbciApp(AbciApp[Event])

TransactionSubmissionAbciApp

Initial round: RandomnessTransactionSubmissionRound

Initial states: {RandomnessTransactionSubmissionRound}

Transition states: 0. RandomnessTransactionSubmissionRound - done: 1. - round timeout: 0. - no majority: 0. 1. SelectKeeperTransactionSubmissionARound - done: 2. - round timeout: 1. - no majority: 10. - incorrect serialization: 12. 2. CollectSignatureRound - done: 3. - round timeout: 2. - no majority: 10. 3. FinalizationRound - done: 4. - check history: 5. - finalize timeout: 7. - finalization failed: 6. - check late arriving message: 8. - insufficient funds: 6. 4. ValidateTransactionRound - done: 11. - negative: 5. - none: 6. - validate timeout: 5. - no majority: 4. 5. CheckTransactionHistoryRound - done: 11. - negative: 6. - none: 12. - check timeout: 5. - no majority: 5. - check late arriving message: 8. 6. SelectKeeperTransactionSubmissionBRound - done: 3. - round timeout: 6. - no majority: 10. - incorrect serialization: 12. 7. SelectKeeperTransactionSubmissionBAfterTimeoutRound - done: 3. - check history: 5. - check late arriving message: 8. - round timeout: 7. - no majority: 10. - incorrect serialization: 12. 8. SynchronizeLateMessagesRound - done: 9. - round timeout: 8. - none: 6. - suspicious activity: 12. 9. CheckLateTxHashesRound - done: 11. - negative: 12. - none: 12. - check timeout: 9. - no majority: 12. - check late arriving message: 8. 10. ResetRound - done: 0. - reset timeout: 12. - no majority: 12. 11. FinishedTransactionSubmissionRound 12. FailedRound

Final states: {FailedRound, FinishedTransactionSubmissionRound}

Timeouts: round timeout: 30.0 finalize timeout: 30.0 validate timeout: 30.0 check timeout: 30.0 reset timeout: 30.0