linera-io/linera-protocol · error · ChainClientError

Cannot revoke the current epoch {0}

Error message

Cannot revoke the current epoch {0}

What it means

Error "Cannot revoke the current epoch {0}" thrown in linera-io/linera-protocol.

Source

Thrown at linera-core/src/client/chain_client/mod.rs:2959

    ) -> Result<Vec<IndexAndEvent>, Error> {
        Ok(self
            .client
            .storage_client()
            .read_events_from_index(&self.chain_id, &stream_id, start_index)
            .await?)
    }

    /// Deprecates all configurations of voting rights up to the given one (admin chains only).
    /// Emits a `RemoveCommittee` event for every still-active epoch up to and including
    /// `revoked_epoch`.
    #[instrument(level = "trace")]
    pub async fn revoke_epochs(
        &self,
        revoked_epoch: Epoch,
    ) -> Result<ClientOutcome<ConfirmedBlockCertificate>, Error> {
        self.prepare_chain().await?;
        let current_epoch = self.chain_info().await?.epoch;
        ensure!(
            revoked_epoch < current_epoch,
            Error::CannotRevokeCurrentEpoch(current_epoch)
        );
        let mut operations = Vec::new();
        for epoch_index in 0..=revoked_epoch.0 {
            let epoch = Epoch(epoch_index);
            if self
                .has_admin_event(REMOVED_EPOCH_STREAM_NAME, epoch.0)
                .await?
            {
                continue;
            }
            operations.push(Operation::system(SystemOperation::Admin(
                AdminOperation::RemoveCommittee { epoch },
            )));
        }
        ensure!(!operations.is_empty(), Error::EpochAlreadyRevoked);
        self.execute_operations(operations, vec![]).await

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. You cannot revoke the current epoch {0}: first rotate to a newer epoch (complete the epoch change/committee reconfiguration), then revoke the older epoch.
  2. Revoke the previous epoch instead of the current one; pass the earlier epoch number to the revoke command.
  3. If revocation is part of key rotation, perform the rotation flow in order so the current epoch advances before revoking.

When it happens

Trigger: An attempt is made to revoke the epoch that is currently in force.

Common situations: Calling epoch revocation for the current epoch instead of an older, superseded one.


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/0f95b870ddf9c348. Report an issue: GitHub.