Skip to content

Support ACP-236 auto-renewed staking P-Chain transaction types #20

@owenwahlgren

Description

@owenwahlgren

Summary

Add support for the three new P-Chain transaction types introduced by ACP-236: Auto-Renewed Staking. This ACP replaces the current fixed-duration staking model with cycle-based auto-renewing validators.

New Transaction Types

1. AddAutoRenewedValidatorTx

Creates an auto-renewing validator position.

Parameters:

  • ValidatorNodeID — Node ID
  • Signer — BLS key
  • StakeOuts — Return destination for staked tokens
  • ValidatorRewardsOwner / DelegatorRewardsOwner — Reward distribution
  • Owner — Controls config updates
  • DelegationShares — Delegation fee (×10,000)
  • Wght — Validator weight
  • AutoCompoundRewardShares — Percentage of rewards to restake (in millionths)
  • Period — Cycle duration in seconds (bounded by MinStakeDuration/MaxStakeDuration)

2. SetAutoRenewedValidatorConfigTx

Modifies an existing auto-renewed validator's config. Changes take effect at cycle end.

Parameters:

  • TxID — Original AddAutoRenewedValidatorTx ID
  • Auth — Owner authorization proof
  • AutoCompoundRewardShares — Updated restake percentage
  • Period — Next cycle duration (set to 0 for graceful exit)

3. RewardAutoRenewedValidatorTx

Handles end-of-cycle reward distribution and validator continuation/exit.

Parameters:

  • TxID — Original validator creation tx ID
  • Timestamp — Cycle end time

Key Behavioral Changes

  • Cycle-based staking: Uptime measured per-cycle with resets at boundaries
  • Auto-compounding: Configurable portion of rewards automatically restaked
  • Graceful exit: Set Period to 0 to stop at cycle end (no immediate unstake)
  • Delegator restrictions: Delegations cannot span multiple cycles
  • Stake overflow: Excess beyond MaxValidatorStake withdrawn to rewards owners

CLI Commands to Add

platform validator add-auto-renewed   # AddAutoRenewedValidatorTx
platform validator set-auto-config     # SetAutoRenewedValidatorConfigTx
platform validator reward-auto         # RewardAutoRenewedValidatorTx (if manual trigger needed)

Implementation Notes

  • Requires upstream avalanchego SDK support for these tx types — track SDK readiness
  • New tx builders needed in pkg/pchain/
  • New cobra commands in cmd/validator.go
  • AutoCompoundRewardShares is expressed in millionths (1,000,000 = 100%)
  • Period of 0 in SetAutoRenewedValidatorConfigTx means "exit after current cycle"
  • Unit tests + e2e tests against local network once avalanchego supports ACP-236

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions