Skip to content

Slashing

The Slashing module provides validator slashing operations including unjailing validators and querying validator signing information for the Akash Network.

Transaction parameters

All transaction functions support flexible parameters. See Transaction parameters for details on available options like fee_amount, gas_limit, and gas_adjustment.

Access slashing operations through the main client:

from akash import AkashClient

client = AkashClient("https://akash-rpc.polkachu.com:443")
slashing_operations = client.slashing

Transactions

unjail()

Unjail a validator that has been jailed for downtime.

def unjail(wallet, validator_address: str = None, memo: str = "",
           fee_amount: str = "5000", gas_limit: int = None, gas_adjustment: float = 1.2,
           use_simulation: bool = True) -> BroadcastResult

Required parameters:

  • wallet (Wallet): Validator's operator wallet

Optional parameters:

  • validator_address (str): Validator address to unjail (default: derives from wallet)
  • memo (str): Transaction memo (default: "")
  • fee_amount (str): Fee amount in uakt (default: "5000")
  • gas_limit (int): Gas limit override (default: None)
  • gas_adjustment (float): Gas estimation multiplier (default: 1.2)
  • use_simulation (bool): Enable gas simulation (default: True)

Returns: BroadcastResult - Transaction result with the following fields:

  • tx_hash (str): Transaction hash
  • code (int): Response code (0 for success)
  • raw_log (str): Raw transaction log/error message
  • success (bool): Whether transaction succeeded
  • events (List[Dict]): Transaction events
    • type (str): Event type
    • attributes (List[Dict]): Event attributes
      • key (str): Attribute key
      • value (str): Attribute value

Example:

from akash import AkashClient, AkashWallet

client = AkashClient("https://akash-rpc.polkachu.com:443")
wallet = AkashWallet.from_mnemonic("validator operator mnemonic")

result = client.slashing.unjail(
    wallet=wallet,
    memo=""
)

result = client.slashing.unjail(
    wallet=wallet,
    validator_address="akashvaloper1...",
    memo=""
)

if result.success:
    print(f"Validator unjailed: {result.tx_hash}")
else:
    print(f"Unjail failed: {result.log}")

Queries

get_params()

Query slashing parameters.

def get_params() -> Dict[str, Any]

Returns: Dict - Slashing parameters with the following fields:

  • signed_blocks_window (str): Signed blocks window size
  • min_signed_per_window (str): Minimum signed blocks per window
  • downtime_jail_duration (str): Duration a validator is jailed for downtime
  • slash_fraction_double_sign (str): Slash fraction for double signing
  • slash_fraction_downtime (str): Slash fraction for downtime

Example:

from akash import AkashClient

client = AkashClient("https://akash-rpc.polkachu.com:443")

params = client.slashing.get_params()
print(f"Signed blocks window: {params['signed_blocks_window']}")
print(f"Downtime jail duration: {params['downtime_jail_duration']}")
print(f"Downtime slash fraction: {params['slash_fraction_downtime']}")

get_signing_info()

Query signing info of a specific validator by consensus address.

def get_signing_info(cons_address: str) -> Dict[str, Any]

Required parameters:

  • cons_address (str): Consensus address of the validator

Returns: Dict - Validator signing info with the following fields:

  • address (str): Validator consensus address
  • start_height (str): Height when validator started signing
  • index_offset (str): Index offset in signing window
  • jailed_until (str): Timestamp until which validator is jailed
  • tombstoned (bool): Whether validator is tombstoned
  • missed_blocks_counter (str): Number of missed blocks

Example:

from akash import AkashClient

client = AkashClient("https://akash-rpc.polkachu.com:443")

info = client.slashing.get_signing_info("akashvalcons1...")

print(f"Validator: {info['address']}")
print(f"Start height: {info['start_height']}")
print(f"Missed blocks: {info['missed_blocks_counter']}")
print(f"Tombstoned: {info['tombstoned']}")

if info['jailed_until'] != "0.000000000Z":
    print(f"Jailed until: {info['jailed_until']}")

get_signing_infos()

Query signing info of all validators.

def get_signing_infos(limit: int = None, offset: int = None) -> List[Dict[str, Any]]

Optional parameters:

  • limit (int): Maximum number of validators to return (default: None)
  • offset (int): Number of validators to skip (default: None)

Returns: List[Dict] - List of validator signing infos (same structure as get_signing_info)

Example:

from akash import AkashClient

client = AkashClient("https://akash-rpc.polkachu.com:443")

infos = client.slashing.get_signing_infos(limit=10)

print(f"Found {len(infos)} validators")
for info in infos:
    missed_blocks = int(info['missed_blocks_counter'])
    status = "Active" if missed_blocks < 100 else "Warning" if missed_blocks < 500 else "Risk"
    print(f"{info['address']}: {missed_blocks} missed blocks - {status}")