You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the part that connects BABE with Provisioner subsystem. Currently, Gossamer does not have a specific struct for inherents, we only define inherents at the moment of block building.
To have a better separation of responsibility we can define an interface InherentProvider and the block builder can have a set of InherentProvider.
We can define the interface in the packagelib/babe, also we can make it generic over the type of inherent it will return.
typeInherentProviderinterface {
// Provide will add the data to `out`Provide(out*types.InherentData) T
}
typeTimestampInherentProviderstruct {}
// slot inherent provider might need timestamp as depedency providertypeSlotInherentProviderstruct {}
// needs the overseer and state as depedenciestypeParachainsInherentProviderstruct {}
Change the BlockBuilder at lib/babe/build.go to have a set of InherentProviders and iterate over them passing a fresh *types.InherentData and them encode it.
Changes might be needed to make timestamp and slot to conform with InherentProvider interface
Given that we now when a slot ends (slot start + duration) set up a timeout timer to avoid going beyond the block producer time slot.
endAt:=slot.start+slot.durationremainingTime:=time.NewTimer(end_at-time.Now())
gocreate_inherent_data()
select {
caseid:=<-inherentDataCh:
// happy path, we got the inherents in timecaseremainingTime.C:
// timeout! inherents not provided in time
}
The text was updated successfully, but these errors were encountered:
EclesioMeloJunior
added
C-complex
Complex changes across multiple modules. Possibly will require additional research.
S-babe
issues related to block production functionality.
labels
Oct 11, 2024
Description
Here is the part that connects BABE with Provisioner subsystem. Currently, Gossamer does not have a specific struct for inherents, we only define inherents at the moment of block building.
To have a better separation of responsibility we can define an interface
InherentProvider
and the block builder can have a set ofInherentProvider
.We can define the interface in the package
lib/babe
, also we can make it generic over the type of inherent it will return.BlockBuilder
atlib/babe/build.go
to have a set ofInherentProviders
and iterate over them passing a fresh*types.InherentData
and them encode it.timestamp
andslot
to conform withInherentProvider interface
Reference
https://github.com/paritytech/polkadot-sdk/blob/c0b734336a68b6f48ac70a9b9507d8ddb9fed57e/polkadot/node/service/src/lib.rs#L1245
https://github.com/paritytech/polkadot-sdk/blob/c0b734336a68b6f48ac70a9b9507d8ddb9fed57e/substrate/client/consensus/slots/src/lib.rs#L250
The text was updated successfully, but these errors were encountered: