Skip to main content
. 2026 Mar 8;28(3):302. doi: 10.3390/e28030302
Algorithm A1 TimesNet-driven adaptive BFT Consensus Loop.
  • Require: 

    History D, View v, Timeout Δv, Leader v

  • Ensure: 

    Next View v+1, Leader v+1, Timeout Δv+1

  •  1:

    Phase 1: Normal Consensus Execution

  •  2:

    Node i executes HotStuff(v,v,Δv)

▹ Standard BFT

  •  3:

    if Block Bv is Committed then

  •  4:

        Extract latency vector Lobs from Bv.Metadata

  •  5:

        DD{Lobs}

▹ History sync, Equation (1)

  •  6:

    else

  •  7:

        Trigger ViewChange

▹ System Reset due to High Entropy

  •  8:

    end if

  •  9:

    Phase 2: TimesNet Inference

  • 10:

    if  |D|Wwarmup  then

  • 11:

        for each node jN do

  • 12:

            L^jTimesNet(D|j,θ)

▹ Predict, Equation (2)

  • 13:

            RjL^j

▹ Assign Robust Metric

  • 14:

        end for

  • 15:

        IsReadyTrue

  • 16:

    else

  • 17:

        IsReadyFalse

▹ Insufficient history

  • 18:

    end if

  • 19:

    Phase 3: Dynamic Parameter Modulation

  • 20:

    if not IsReady then

▹ Cold Start Mode

  • 21:

        v+1(vmodN)+1

▹ Fallback: Round-Robin

  • 22:

        Δv+1Δstatic

▹ Fixed Timeout

  • 23:

    else

▹ AI-Driven Mode

  • 24:

        j*argminjNRj

  • 25:

        Degrade(RvEMA(R))/EMA(R)

  • 26:

        // 1. Leader Selection Logic

  • 27:

        if (RvRj*)/Rv>δ or Degrade>ζ then

  • 28:

            v+1j*

▹ Proactive Entropy Reduction, Equation (5)

  • 29:

        else

  • 30:

            v+1v

▹ Keep Incumbent

  • 31:

        end if

  • 32:

        // 2. Timeout Calibration Logic

  • 33:

        if v(modWc)=0v+1v then

  • 34:

            Δrawα·Rv+1+(1α)·Δv

▹ Equation (6)

  • 35:

            Δv+1Clip(Δraw,Δmin,Δmax)

▹ Cooling-off

  • 36:

        else

  • 37:

            Δv+1Δv

  • 38:

        end if

  • 39:

    end if

  • 40:

    return  vv+1,v+1,Δv+1