Skip to content

Epoch orchestration layer#427

Open
yacovm wants to merge 1 commit into
mainfrom
orchestration
Open

Epoch orchestration layer#427
yacovm wants to merge 1 commit into
mainfrom
orchestration

Conversation

@yacovm

@yacovm yacovm commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread instance.go
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package simplex

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the orchastration be in its own package?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to put this in the top most package, to make it clear that it is the entry point to simplex.

Comment thread instance.go Outdated
// Parameter config
Epoch: epochNum,
ReplicationEnabled: true,
StartTime: time.Now(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the orchestration layer have its own time field? i don't see where we forward/call advanceTime

Comment thread instance.go Outdated
Comment on lines +183 to +184
MaxProposalWait: i.Config.MaxProposalWait,
MaxRebroadcastWait: i.Config.MaxRebroadcastWait,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should change in a seperate pr these to be consistent with avalanche go

MaxNetworkDelay    time.Duration   `json:"maxNetworkDelay"    yaml:"maxNetworkDelay"`
MaxRebroadcastWait time.Duration   `json:"maxRebroadcastWait" yaml:"maxRebroadcastWait"`

Comment thread instance.go
)


type Config struct {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this type of structure is more organized? this way we can see exactly what is used for the MSM vs epoch vs shared

type Config struct {
      // Shared by both the metadata state machine and the epoch.
      Common CommonConfig
      // Used only to build the metadata state machine.
      MSM    MSMConfig
      // Used only to build the simplex epoch.
      Epoch  EpochParams
}

type CommonConfig struct {
      Logger                     common.Logger
      Signer                     common.Signer
      SignatureAggregatorCreator common.SignatureAggregatorCreator
      VM                         VM
}

type MSMConfig struct {
      GenesisValidatorSet         metadata.NodeBLSMappings
      LastNonSimplexInnerBlock    metadata.VMBlock
      GetPChainHeightForProposing func() uint64
      GetPChainHeightForVerifying func() uint64
      ComputeICMEpoch             metadata.ICMEpochTransition
}

type EpochParams struct {
      ID                         common.NodeID
      Sender                     Sender
      Storage                    Storage
      QCDeserializer             common.QCDeserializer
      BlockDeserializer          common.BlockDeserializer
      Verifier                   common.SignatureVerifier
      MaxProposalWait            time.Duration
      MaxRoundWindow             uint64
      MaxRebroadcastWait         time.Duration
      FinalizeRebroadcastTimeout time.Duration
      MaxWALSize                 int
      WALCreator                 wal.Creator
      WALs                       []wal.DeletableWAL
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could also help with the organization we talked about at Monday's consensus sync. The caller can see which interfaces it needs to implement and which purposes

Comment thread instance.go Outdated
PChainProgressListener metadata.PChainProgressListener
// LastNonSimplexBlockPChainHeight is the P-chain height of the last block built by a non-Simplex proposer.
// It is used to determine the validator set of the first ever Simplex h.
LastNonSimplexBlockPChainHeight uint64

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont see where this is uesd

Comment thread instance.go Outdated

ComputeICMEpoch metadata.ICMEpochTransition
// PChainProgressListener listens for changes in the P-chain height to trigger block building or h transitions.
PChainProgressListener metadata.PChainProgressListener

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, this isn't used anywhere

Comment thread adapters.go

func (e *EpochAwareStorage) Index(ctx context.Context, block common.VerifiedBlock, certificate common.Finalization) error {
if block.BlockHeader().Epoch < e.Epoch {
// This is a Telock from a previous h, so we ignore it and do not index it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this mean the block is a telock? don't telocks have the same epoch as the sealing block?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a Telock from the previous epoch. We may collect a finalization on a Telock and then we first index the sealing block and then the Telocks. Once we index the sealing block, we increment our epoch, right?
We don't want to index the Telocks too, so this is a safeguard against that.

@yacovm yacovm force-pushed the orchestration branch 6 times, most recently from 1779bd4 to e01b21c Compare June 30, 2026 23:29
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants