Skip to content

Gloas -- Weak Subjectivity Guide

Introduction

This document is an extension of the Electra -- Weak Subjectivity Guide. All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden.

This document is a guide for implementing Weak Subjectivity protections in Gloas. The Weak Subjectivity Period (WSP) calculations have changed in Gloas due to EIP-8061, which separates activation, exit, and consolidation churn into independently tunable parameters.

Weak Subjectivity Period

Calculating the Weak Subjectivity Period

Modified compute_weak_subjectivity_period

def compute_weak_subjectivity_period(state: BeaconState) -> Epoch:
    """
    Returns the weak subjectivity period for the current ``state``.
    This computation takes into account the effect of:
        - exit churn (weighted 2/3)
        - activation churn (weighted 1/3)
        - consolidation churn (weighted 1)
    """
    t = get_total_active_balance(state)
    # [Modified in Gloas:EIP8061]
    delta = (
        2 * get_exit_churn_limit(state) // 3
        + get_activation_churn_limit(state) // 3
        + get_consolidation_churn_limit(state)
    )
    epochs_for_validator_set_churn = Epoch(SAFETY_DECAY * t // (2 * delta * 100))
    return MIN_VALIDATOR_WITHDRAWABILITY_DELAY + epochs_for_validator_set_churn

A brief reference for what these values look like in practice (reference script):

Safety Decay Total Active Balance (ETH) Weak Sub. Period (Epochs)
10 1,048,576 620
10 2,097,152 911
10 4,194,304 1,348
10 8,388,608 1,348
10 16,777,216 1,484
10 33,554,432 1,566
10 67,108,864 1,611
10 134,217,728 1,635