Skip to content

Commit 047fb0c

Browse files
committed
Implement consensus task (WIP)
1 parent d17f8d9 commit 047fb0c

16 files changed

Lines changed: 789 additions & 965 deletions

File tree

pkg/granite/common/common.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
granitepbtypes "github.com/filecoin-project/mir/pkg/pb/granitepb/types"
77
trantorpbtypes "github.com/filecoin-project/mir/pkg/pb/trantorpb/types"
88
t "github.com/filecoin-project/mir/pkg/types"
9+
"time"
910
)
1011

1112
// ModuleConfig sets the module ids. All replicas are expected to use identical module configurations.
@@ -32,6 +33,8 @@ type ModuleParams struct {
3233
Membership *trantorpbtypes.Membership `json:"-"`
3334

3435
Crypto crypto.Crypto
36+
37+
ConvergeDelay time.Duration
3538
}
3639

3740
type Step = granite.MsgType
@@ -44,6 +47,9 @@ type State struct {
4447

4548
//Decision messages do not need to be stored per round
4649
DecisionMessages map[t.NodeID]map[string]*granitepbtypes.Decision
50+
51+
Proposal []byte
52+
Value []byte
4753
}
4854

4955
func (st *State) IsValid(msg *granitepbtypes.ConsensusMsg) bool {

pkg/granite/granite.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type ModuleConfig = common.ModuleConfig
2121
type ModuleParams = common.ModuleParams
2222

2323
// NewModule creates a new instance of the Granite consensus protocol
24-
func NewModule(mc ModuleConfig, params *ModuleParams, logger logging.Logger) (modules.PassiveModule, error) {
24+
func NewModule(mc *ModuleConfig, params *ModuleParams, logger logging.Logger) (modules.PassiveModule, error) {
2525
m := dsl.NewModule(mc.Self)
2626

2727
state := &common.State{
@@ -68,7 +68,7 @@ func NewReconfigurableModule(mc ModuleConfig, paramsTemplate ModuleParams, logge
6868

6969
// Create a new instance of granite.
7070
granite, err := NewModule(
71-
submc,
71+
&submc,
7272
&moduleParams,
7373
logger,
7474
)

0 commit comments

Comments
 (0)