Documentation ¶
Overview ¶
Package proposer is a generated GoMock package.
Index ¶
- Constants
- Variables
- func TimeToSlot(start, now time.Time) uint64
- type MockWindower
- func (m *MockWindower) Delay(arg0 context.Context, arg1, arg2 uint64, arg3 ids.NodeID, arg4 int) (time.Duration, error)
- func (m *MockWindower) EXPECT() *MockWindowerMockRecorder
- func (m *MockWindower) ExpectedProposer(arg0 context.Context, arg1, arg2, arg3 uint64) (ids.NodeID, error)
- func (m *MockWindower) MinDelayForProposer(arg0 context.Context, arg1, arg2 uint64, arg3 ids.NodeID, arg4 uint64) (time.Duration, error)
- func (m *MockWindower) Proposers(arg0 context.Context, arg1, arg2 uint64, arg3 int) ([]ids.NodeID, error)
- type MockWindowerMockRecorder
- func (mr *MockWindowerMockRecorder) Delay(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
- func (mr *MockWindowerMockRecorder) ExpectedProposer(arg0, arg1, arg2, arg3 any) *gomock.Call
- func (mr *MockWindowerMockRecorder) MinDelayForProposer(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
- func (mr *MockWindowerMockRecorder) Proposers(arg0, arg1, arg2, arg3 any) *gomock.Call
- type Windower
Constants ¶
View Source
const ( WindowDuration = 5 * time.Second MaxVerifyWindows = 6 MaxVerifyDelay = MaxVerifyWindows * WindowDuration // 30 seconds MaxBuildWindows = 60 MaxBuildDelay = MaxBuildWindows * WindowDuration // 5 minutes MaxLookAheadSlots = 720 MaxLookAheadWindow = MaxLookAheadSlots * WindowDuration // 1 hour )
Proposer list constants
Variables ¶
View Source
var (
ErrAnyoneCanPropose = errors.New("anyone can propose")
)
Functions ¶
func TimeToSlot ¶
Types ¶
type MockWindower ¶
type MockWindower struct {
// contains filtered or unexported fields
}
MockWindower is a mock of Windower interface.
func NewMockWindower ¶
func NewMockWindower(ctrl *gomock.Controller) *MockWindower
NewMockWindower creates a new mock instance.
func (*MockWindower) Delay ¶
func (m *MockWindower) Delay(arg0 context.Context, arg1, arg2 uint64, arg3 ids.NodeID, arg4 int) (time.Duration, error)
Delay mocks base method.
func (*MockWindower) EXPECT ¶
func (m *MockWindower) EXPECT() *MockWindowerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockWindower) ExpectedProposer ¶
func (m *MockWindower) ExpectedProposer(arg0 context.Context, arg1, arg2, arg3 uint64) (ids.NodeID, error)
ExpectedProposer mocks base method.
type MockWindowerMockRecorder ¶
type MockWindowerMockRecorder struct {
// contains filtered or unexported fields
}
MockWindowerMockRecorder is the mock recorder for MockWindower.
func (*MockWindowerMockRecorder) Delay ¶
func (mr *MockWindowerMockRecorder) Delay(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
Delay indicates an expected call of Delay.
func (*MockWindowerMockRecorder) ExpectedProposer ¶
func (mr *MockWindowerMockRecorder) ExpectedProposer(arg0, arg1, arg2, arg3 any) *gomock.Call
ExpectedProposer indicates an expected call of ExpectedProposer.
func (*MockWindowerMockRecorder) MinDelayForProposer ¶
func (mr *MockWindowerMockRecorder) MinDelayForProposer(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
MinDelayForProposer indicates an expected call of MinDelayForProposer.
type Windower ¶
type Windower interface { // Proposers returns the proposer list for building a block at [blockHeight] // when the validator set is defined at [pChainHeight]. The list is returned // in order. The minimum delay of a validator is the index they appear times // [WindowDuration]. Proposers( ctx context.Context, blockHeight, pChainHeight uint64, maxWindows int, ) ([]ids.NodeID, error) // Delay returns the amount of time that [validatorID] must wait before // building a block at [blockHeight] when the validator set is defined at // [pChainHeight]. Delay( ctx context.Context, blockHeight, pChainHeight uint64, validatorID ids.NodeID, maxWindows int, ) (time.Duration, error) // In the Post-Durango windowing scheme, every validator active at // [pChainHeight] gets specific slots it can propose in (instead of being // able to propose from a given time on as it happens Pre-Durango). // [ExpectedProposer] calculates which nodeID is scheduled to propose a // block of height [blockHeight] at [slot]. // If no validators are currently available, [ErrAnyoneCanPropose] is // returned. ExpectedProposer( ctx context.Context, blockHeight, pChainHeight, slot uint64, ) (ids.NodeID, error) // In the Post-Durango windowing scheme, every validator active at // [pChainHeight] gets specific slots it can propose in (instead of being // able to propose from a given time on as it happens Pre-Durango). // [MinDelayForProposer] specifies how long [nodeID] needs to wait for its // slot to start. Delay is specified as starting from slot zero start. // (which is parent timestamp). For efficiency reasons, we cap the slot // search to [MaxLookAheadSlots]. // If no validators are currently available, [ErrAnyoneCanPropose] is // returned. MinDelayForProposer( ctx context.Context, blockHeight, pChainHeight uint64, nodeID ids.NodeID, startSlot uint64, ) (time.Duration, error) }
Click to show internal directories.
Click to hide internal directories.