diff --git a/pkg/accountability/simpleacc/accountability.go b/pkg/accountability/simpleacc/accountability.go new file mode 100644 index 000000000..9e0a7f92b --- /dev/null +++ b/pkg/accountability/simpleacc/accountability.go @@ -0,0 +1,142 @@ +package simpleacc + +import ( + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/common" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/certificates/fullcertificates" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/certificates/lightcertificates" + incommon "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/common" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/poms" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/predecisions" + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/factorymodule" + "github.com/filecoin-project/mir/pkg/logging" + "github.com/filecoin-project/mir/pkg/modules" + accpbtypes "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + factorypbtypes "github.com/filecoin-project/mir/pkg/pb/factorypb/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +// ModuleConfig sets the module ids. All replicas are expected to use identical module configurations. +type ModuleConfig = common.ModuleConfig + +// ModuleParams sets the values for the parameters of an instance of the protocol. +// All replicas are expected to use identical module parameters. +type ModuleParams = common.ModuleParams + +// NewModule creates a new instance of the (optinal) accountability +// module. +// This module can receive decisions from a module that ensures agreement +// (for example, receive a decision from the ordering module, instead of +// the ordering module delivering them to the application layer directly), +// and treats them as predecisions. It performs two all-to-all broadcasts +// with signatures to ensure accountability. The first broadcast is a +// signed predecision per participant. In the second broadcast, each +// participant broadcasts a certificate containing a strong quorum of +// signed predecisions that they each delivered from the first +// broadcast. Termination occurs once a process receives a strong quorum +// of correctly signed predecisions. +// *Accountability* states that if an adversary (controlling less than a +// strong quorum, but perhaps more or as much as a weak quorum) causes +// a disagreement (two different correct processes delivering different +// decisions) then all correct processes eventually receive Proofs-of-Misbehavior (PoMs) +// for a provably malicious coalition at least the size of a weak quorum. +// In the case of this module, a PoM is a pair of different predecisions signed +// by the same node. +// The module keeps looking for PoMs with newly received messages +// (signed predecisions or certificates) after termination, until +// it is garbage collected. +// +// Intuition of correctness: a process only terminates if it receives a +// strong quorum of signed predecisions from distinct processes, forming +// a certificate. Once this process forms a certificate, it shares it +// with the rest of participants. If all correct processes terminate, +// then that means all correct processes will (i) deliver a strong quorum +// of signed predecisions and (ii) broadcast them in a certificate. Thus, +// if two correct processes p_1, p_2 disagree (decide d_1, d_2, +// respectively) then that means they must have each delivered a strong +// quorum of signed predecisions for different predecisions. By quorum +// intersection, this means that at least a weak quorum of processes have +// signed respective predecisions for d_1, d_2 and sent each of them to +// the respective correct process p_1, p_2. Once p_1 receives the +// certificate that p_2 broadcasted, p_1 will then generate a weak quorum +// of PoMs (and vice versa) and broadcast it to the rest of processes. +// +// This module effectively implements a variant of the accountability +// module of Civit et al. at https://ieeexplore.ieee.org/document/9820722/ +// Except that it does not implement the optimization using threshold +// signatures (as we have members with associated weight) +// +// The optimistic variant of this module is a parametrizable optimization +// in which certificates are optimistically believed to be correct. This way, +// in the good case a correct process broadcasts a light certificate of O(1) bits +// (instead of O(n) of a certificate) +// and only actually sends the full certificate to nodes from which it receives a light certificate +// for a predecision other than the locally Decided one. The recipient of the certificate can then +// generate and broadcast the PoMs. +// +// ATTENTION: This module is intended to be used once per instance +// (to avoid replay attacks) and reinstantiated in a factory. +func NewModule( + mc ModuleConfig, + params *ModuleParams, + logger logging.Logger) (modules.PassiveModule, error) { + m := dsl.NewModule(mc.Self) + + state := &incommon.State{ + SignedPredecisions: make(map[t.NodeID]*accpbtypes.SignedPredecision), + PredecisionNodeIDs: make(map[string][]t.NodeID), + LocalPredecision: nil, + DecidedCertificate: nil, + Predecided: false, + UnhandledPoMs: make([]*accpbtypes.PoM, 0), + HandledPoMs: make(map[t.NodeID]*accpbtypes.PoM), + } + + predecisions.IncludePredecisions(m, &mc, params, state, logger) + fullcertificates.IncludeFullCertificate(m, &mc, params, state, logger) + if params.LightCertificates { + lightcertificates.IncludeLightCertificate(m, &mc, params, state, logger) + } + poms.IncludePoMs(m, &mc, params, state, logger) + + return m, nil +} + +func NewReconfigurableModule(mc ModuleConfig, paramsTemplate ModuleParams, logger logging.Logger) modules.PassiveModule { + if logger == nil { + logger = logging.ConsoleErrorLogger + } + return factorymodule.New( + mc.Self, + factorymodule.DefaultParams( + + // This function will be called whenever the factory module + // is asked to create a new instance of the accountabuility module. + func(accID t.ModuleID, params *factorypbtypes.GeneratorParams) (modules.PassiveModule, error) { + + accParams := params.Type.(*factorypbtypes.GeneratorParams_AccModule).AccModule + + // Create a copy of basic module config with an adapted ID for the submodule. + submc := mc + submc.Self = accID + + // Fill in instance-specific parameters. + moduleParams := paramsTemplate + moduleParams.Membership = accParams.Membership + moduleParams.RetentionIndex = accParams.RetentionIndex + + // Create a new instance of the multisig collector. + accountabilityModule, err := NewModule( + submc, + &moduleParams, + logger, + ) + if err != nil { + return nil, err + } + return accountabilityModule, nil + }, + ), + logger, + ) +} diff --git a/pkg/accountability/simpleacc/common/common.go b/pkg/accountability/simpleacc/common/common.go new file mode 100644 index 000000000..97a71db74 --- /dev/null +++ b/pkg/accountability/simpleacc/common/common.go @@ -0,0 +1,39 @@ +package common + +import ( + incommon "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/common" + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/logging" + accpbtypes "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + trantorpbtypes "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" + timertypes "github.com/filecoin-project/mir/pkg/timer/types" + tt "github.com/filecoin-project/mir/pkg/trantor/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +// ModuleConfig sets the module ids. All replicas are expected to use identical module configurations. +type ModuleConfig struct { + Self t.ModuleID // id of this module, used to uniquely identify an instance of the accountability module. + // It prevents cross-instance signature replay attack and should be unique across all executions. + + Ordering t.ModuleID // provides Predecisions + App t.ModuleID // receives Decisions and/or PoMs + Crypto t.ModuleID // provides cryptographic primitives + Timer t.ModuleID // provides Timing primitives + Net t.ModuleID // provides network primitives +} + +// ModuleParams sets the values for the parameters of an instance of the protocol. +// All replicas are expected to use identical module parameters. +type ModuleParams struct { + Membership *trantorpbtypes.Membership // The list of participating nodes. + LightCertificates bool + ResendFrequency timertypes.Duration // Frequency with which messages in the critical path are re-sent + RetentionIndex tt.RetentionIndex + PoMsHandler func(m dsl.Module, // Function to be called when PoMs detected. + mc *ModuleConfig, + params *ModuleParams, + state *incommon.State, + poms []*accpbtypes.PoM, + logger logging.Logger) +} diff --git a/pkg/accountability/simpleacc/internal/certificates/fullcertificates/fullcertificates.go b/pkg/accountability/simpleacc/internal/certificates/fullcertificates/fullcertificates.go new file mode 100644 index 000000000..7b6d4f082 --- /dev/null +++ b/pkg/accountability/simpleacc/internal/certificates/fullcertificates/fullcertificates.go @@ -0,0 +1,78 @@ +package fullcertificates + +import ( + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/common" + incommon "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/common" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/poms" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/predecisions" + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/logging" + accpbdsl "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/dsl" + accpbtypes "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + cryptopbdsl "github.com/filecoin-project/mir/pkg/pb/cryptopb/dsl" + cryptopbtypes "github.com/filecoin-project/mir/pkg/pb/cryptopb/types" + t "github.com/filecoin-project/mir/pkg/types" + "github.com/filecoin-project/mir/pkg/util/maputil" + "github.com/filecoin-project/mir/pkg/util/membutil" + "github.com/filecoin-project/mir/pkg/util/sliceutil" +) + +// IncludeFullCertificate implements the full certificate brodcast and verification +// in order to find PoMs. +func IncludeFullCertificate(m dsl.Module, + mc *common.ModuleConfig, + params *common.ModuleParams, + state *incommon.State, + logger logging.Logger, +) { + + accpbdsl.UponFullCertificateReceived(m, func(from t.NodeID, decision []byte, certificate map[t.NodeID][]byte) error { + if len(certificate) == 0 { + logger.Log(logging.LevelDebug, "Ignoring empty predecision certificate") + return nil + } + + if !membutil.HaveStrongQuorum(params.Membership, maputil.GetKeys(certificate)) { + logger.Log(logging.LevelDebug, "Ignoring predecision certificate without strong quorum") + return nil + } + + // Verify all signatures in certificate. + cryptopbdsl.VerifySigs( + m, + mc.Crypto, + sliceutil.Generate( + len(certificate), + func(i int) *cryptopbtypes.SignedData { + return &cryptopbtypes.SignedData{ + Data: [][]byte{decision}, + } + }), + maputil.GetValues(certificate), + maputil.GetKeys(certificate), + &verifySigs{ + certificate: &accpbtypes.FullCertificate{ + Decision: decision, + Signatures: certificate, + }, + }, + ) + return nil + }) + + cryptopbdsl.UponSigsVerified(m, func(nodeIds []t.NodeID, errs []error, allOk bool, vsr *verifySigs) error { + for i, nodeID := range nodeIds { + sp := &accpbtypes.SignedPredecision{ + Predecision: vsr.certificate.Decision, + Signature: vsr.certificate.Signatures[nodeID], + } + predecisions.ApplySigVerified(m, mc, params, state, nodeID, errs[i], sp, false, logger) + } + poms.HandlePoMs(m, mc, params, state, logger) + return nil + }) +} + +type verifySigs struct { + certificate *accpbtypes.FullCertificate +} diff --git a/pkg/accountability/simpleacc/internal/certificates/lightcertificates/lightcertificates.go b/pkg/accountability/simpleacc/internal/certificates/lightcertificates/lightcertificates.go new file mode 100644 index 000000000..f9fd90518 --- /dev/null +++ b/pkg/accountability/simpleacc/internal/certificates/lightcertificates/lightcertificates.go @@ -0,0 +1,77 @@ +package lightcertificates + +import ( + "reflect" + + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/common" + incommon "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/common" + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/logging" + accpbdsl "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/dsl" + accpbmsgs "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/msgs" + transportpbdsl "github.com/filecoin-project/mir/pkg/pb/transportpb/dsl" + t "github.com/filecoin-project/mir/pkg/types" +) + +// IncludeLightCertificate implements the (optional) light certificate optimization +// that optimistically sends only the predecision during the light certificate +// so that in the good case where there are no disagreements and all processes +// are correct there is no need to broadcast a full certificate containing O(n) signatures. +func IncludeLightCertificate(m dsl.Module, + mc *common.ModuleConfig, + params *common.ModuleParams, + state *incommon.State, + logger logging.Logger, +) { + + accpbdsl.UponLightCertificateReceived(m, func(from t.NodeID, data []byte) error { + + if !params.LightCertificates { + return nil + } + + if state.DecidedCertificate == nil { + logger.Log(logging.LevelDebug, "Received light certificate before decided certificate, buffering it") + state.LightCertificates[from] = data + return nil + } + + applyLightCertificateReceived(m, mc, state, from, data, logger) + return nil + }) +} + +func applyLightCertificateReceived( + m dsl.Module, + mc *common.ModuleConfig, + state *incommon.State, + from t.NodeID, + data []byte, + logger logging.Logger) { + + decision := state.DecidedCertificate.Decision + + if !reflect.DeepEqual(decision, data) { + logger.Log(logging.LevelWarn, "Received light certificate with different predecision than local decision! sending full certificate to node %v", from) + transportpbdsl.SendMessage( + m, + mc.Net, + accpbmsgs.FullCertificate(mc.Self, + state.DecidedCertificate.Decision, + state.DecidedCertificate.Signatures), + []t.NodeID{from}) + } + +} + +func ApplyLightCertificatesBuffered( + m dsl.Module, + mc *common.ModuleConfig, + state *incommon.State, + logger logging.Logger) { + + for from, data := range state.LightCertificates { + applyLightCertificateReceived(m, mc, state, from, data, logger) + } + +} diff --git a/pkg/accountability/simpleacc/internal/common/common.go b/pkg/accountability/simpleacc/internal/common/common.go new file mode 100644 index 000000000..8d1102b46 --- /dev/null +++ b/pkg/accountability/simpleacc/internal/common/common.go @@ -0,0 +1,42 @@ +package common + +import ( + accpbtypes "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + isspbtypes "github.com/filecoin-project/mir/pkg/pb/isspb/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +type State struct { + + // Map of received signed predicisions (including own) with their signer as key. + SignedPredecisions map[t.NodeID]*accpbtypes.SignedPredecision + + // Map of predecisions and the nodes that have signed them with the predecision as key, + PredecisionNodeIDs map[string][]t.NodeID + + // -------------------------------------------------------------------------------- + // Used for fast verification of whether a predecision is predecided by a strong quorum. + + // Decision locally decided + LocalPredecision *LocalPredecision + + // Locally decided certificate (predecision and list of signatures with signers as key) + DecidedCertificate *accpbtypes.FullCertificate + + // Whether this process has received a predecided value from calling module. + Predecided bool + + // List of PoMs not yet sent to the application. + UnhandledPoMs []*accpbtypes.PoM + + // List of PoMs already sent to the application with the signer as key. + HandledPoMs map[t.NodeID]*accpbtypes.PoM + + // Map of light certificates with the signer as key, buffered if no local decision made yet. + LightCertificates map[t.NodeID][]byte +} + +type LocalPredecision struct { + SBDeliver *isspbtypes.SBDeliver // Actual payload of the local predecision. + SignedPredecision *accpbtypes.SignedPredecision // Own signed predecision. +} diff --git a/pkg/accountability/simpleacc/internal/poms/poms.go b/pkg/accountability/simpleacc/internal/poms/poms.go new file mode 100644 index 000000000..409a50e12 --- /dev/null +++ b/pkg/accountability/simpleacc/internal/poms/poms.go @@ -0,0 +1,108 @@ +package poms + +import ( + "reflect" + + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/common" + incommon "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/common" + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/logging" + accpbdsl "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/dsl" + accpbtypes "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + cryptopbdsl "github.com/filecoin-project/mir/pkg/pb/cryptopb/dsl" + cryptopbtypes "github.com/filecoin-project/mir/pkg/pb/cryptopb/types" + t "github.com/filecoin-project/mir/pkg/types" +) + +// IncludePoMs verifies receives PoMs and sends found PoMs to other members. +func IncludePoMs( + m dsl.Module, + mc *common.ModuleConfig, + params *common.ModuleParams, + state *incommon.State, + logger logging.Logger, +) { + accpbdsl.UponPoMsReceived(m, func(from t.NodeID, poms []*accpbtypes.PoM) error { + nodeIds := make([]t.NodeID, 0, 2*len(poms)) + data := make([]*cryptopbtypes.SignedData, 0, 2*len(poms)) + signatures := make([][]byte, 0, 2*len(poms)) + + for _, pom := range poms { + if reflect.DeepEqual(pom.ConflictingMsg_1.Predecision, pom.ConflictingMsg_2.Predecision) || + reflect.DeepEqual(pom.ConflictingMsg_1.Signature, pom.ConflictingMsg_2.Signature) { + // no PoM possible here + continue + } + + if _, ok := params.Membership.Nodes[pom.NodeId]; !ok { + continue + } + + if _, ok := state.HandledPoMs[pom.NodeId]; ok { + continue + } + + nodeIds = append(nodeIds, pom.NodeId, pom.NodeId) + + data = append(data, + &cryptopbtypes.SignedData{Data: [][]byte{pom.ConflictingMsg_1.Predecision, []byte(mc.Self)}}, + &cryptopbtypes.SignedData{Data: [][]byte{pom.ConflictingMsg_2.Predecision, []byte(mc.Self)}}) + + signatures = append(signatures, pom.ConflictingMsg_1.Signature, pom.ConflictingMsg_2.Signature) + } + + if len(data) == 0 { + logger.Log(logging.LevelDebug, "Received empty PoM") + return nil + } + + cryptopbdsl.VerifySigs( + m, + mc.Crypto, + data, + signatures, + nodeIds, + &verifyPoMs{poms}, + ) + return nil + }) + + cryptopbdsl.UponSigsVerified(m, func(nodeIds []t.NodeID, errs []error, allOk bool, vpoms *verifyPoMs) error { + for i := 0; i < len(nodeIds); i += 2 { + if errs[i] == nil && errs[i+1] == nil { + state.UnhandledPoMs = append(state.UnhandledPoMs, vpoms.poms[i/2]) + } + } + + HandlePoMs(m, mc, params, state, logger) + + return nil + }) +} + +// HandlePoMs sends all PoMs in State.UnhandledPoMs to all nodes and to the application module (from the POV of this module, i.e. mc.App). +func HandlePoMs( + m dsl.Module, + mc *common.ModuleConfig, + params *common.ModuleParams, + state *incommon.State, + logger logging.Logger, +) { + if len(state.UnhandledPoMs) == 0 { + return + } + logger.Log(logging.LevelWarn, "Found valid PoMs! sending...") + + // Handle PoMs according to the application's logic defined when creating the accountability factory + params.PoMsHandler(m, mc, params, state, state.UnhandledPoMs, logger) + + for _, pom := range state.UnhandledPoMs { + state.HandledPoMs[pom.NodeId] = pom + } + + state.UnhandledPoMs = make([]*accpbtypes.PoM, 0) +} + +type verifyPoMs struct { + poms []*accpbtypes.PoM +} diff --git a/pkg/accountability/simpleacc/internal/predecisions/predecisions.go b/pkg/accountability/simpleacc/internal/predecisions/predecisions.go new file mode 100644 index 000000000..e91bd1be3 --- /dev/null +++ b/pkg/accountability/simpleacc/internal/predecisions/predecisions.go @@ -0,0 +1,258 @@ +package predecisions + +import ( + "reflect" + "sync" + + "github.com/fxamacker/cbor/v2" + + eventpbdsl "github.com/filecoin-project/mir/pkg/pb/eventpb/dsl" + eventpbtypes "github.com/filecoin-project/mir/pkg/pb/eventpb/types" + + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/certificates/lightcertificates" + isspbdsl "github.com/filecoin-project/mir/pkg/pb/isspb/dsl" + isspbtypes "github.com/filecoin-project/mir/pkg/pb/isspb/types" + tt "github.com/filecoin-project/mir/pkg/trantor/types" + + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/common" + incommon "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/common" + "github.com/filecoin-project/mir/pkg/accountability/simpleacc/internal/poms" + "github.com/filecoin-project/mir/pkg/dsl" + "github.com/filecoin-project/mir/pkg/logging" + accpbdsl "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/dsl" + accpbmsgs "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/msgs" + accpbtypes "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + cryptopbdsl "github.com/filecoin-project/mir/pkg/pb/cryptopb/dsl" + cryptopbtypes "github.com/filecoin-project/mir/pkg/pb/cryptopb/types" + transportpbdsl "github.com/filecoin-project/mir/pkg/pb/transportpb/dsl" + transportpbevents "github.com/filecoin-project/mir/pkg/pb/transportpb/events" + t "github.com/filecoin-project/mir/pkg/types" + "github.com/filecoin-project/mir/pkg/util/maputil" + "github.com/filecoin-project/mir/pkg/util/membutil" +) + +// IncludePredecisions implements the broadcast and treatment of predecisions. +// The broadcast and treatment of certificates is +// externalized to the ../certificates package so that a system can decide whether to instantiate the accountability +// module with full certificates or with the optimistic light certificates. +// The broadcast and treatment of PoMs is also externalized to the ../poms package. +func IncludePredecisions( + m dsl.Module, + mc *common.ModuleConfig, + params *common.ModuleParams, + state *incommon.State, + logger logging.Logger, +) { + + // Upon predecision received, sign it and broadcast it. + isspbdsl.UponSBDeliver(m, + func(sn tt.SeqNr, data []uint8, aborted bool, leader t.NodeID, instanceId t.ModuleID) error { + + if state.Predecided { + logger.Log(logging.LevelWarn, "Received Predecided event while already Predecided") + return nil + } + + state.Predecided = true + + predecision := &isspbtypes.SBDeliver{ + Sn: sn, + Data: data, + Aborted: aborted, + Leader: leader, + InstanceId: instanceId, + } + + serializedPredecision, err := serializePredecision(predecision) + + if err != nil { + logger.Log(logging.LevelError, "Error serializing predecision", err) + return err + } + + state.LocalPredecision = &incommon.LocalPredecision{ + SBDeliver: predecision, + SignedPredecision: &accpbtypes.SignedPredecision{ + Predecision: serializedPredecision, + }, + } + + // Sign predecision attaching mc.Self to prevent replay attacks. + cryptopbdsl.SignRequest(m, + mc.Crypto, + &cryptopbtypes.SignedData{ + Data: [][]byte{serializedPredecision}}, + &signRequest{data: serializedPredecision}) + + return nil + }) + + cryptopbdsl.UponSignResult(m, func(signature []byte, sr *signRequest) error { + state.LocalPredecision.SignedPredecision.Signature = signature + + // Broadcast signed predecision to all participants (including oneself). + eventpbdsl.TimerRepeat(m, + mc.Timer, + []*eventpbtypes.Event{transportpbevents.SendMessage(mc.Net, accpbmsgs.SignedPredecision(mc.Self, sr.data, signature), maputil.GetKeys(params.Membership.Nodes))}, + params.ResendFrequency, + params.RetentionIndex, + ) + + return nil + }) + + accpbdsl.UponSignedPredecisionReceived(m, func(from t.NodeID, predecision []byte, signature []byte) error { + + if state.SignedPredecisions[from] != nil { + if reflect.DeepEqual(state.SignedPredecisions[from].Predecision, predecision) { + logger.Log(logging.LevelDebug, "Received the same predecision from node %v twice, ignoring", from) + return nil + } + } + + // Verify signature of received signed predecision. + cryptopbdsl.VerifySig(m, mc.Crypto, + &cryptopbtypes.SignedData{Data: [][]byte{predecision, []byte(mc.Self)}}, + signature, + from, + &accpbtypes.SignedPredecision{ + Predecision: predecision, + Signature: signature}) + + return nil + }) + + cryptopbdsl.UponSigVerified(m, func(nodeId t.NodeID, err error, sp *accpbtypes.SignedPredecision) error { + ApplySigVerified(m, mc, params, state, nodeId, err, sp, true, logger) + return nil + }) + +} + +// ApplySigVerified applies the result of a signature verification. +// This function is called once a received signed predecision is verified, but also +// For all signatures of a signed predecision contained in a received certificate +// once they are verified. +func ApplySigVerified( + m dsl.Module, + mc *common.ModuleConfig, + params *common.ModuleParams, + state *incommon.State, + nodeID t.NodeID, + err error, + sp *accpbtypes.SignedPredecision, + flushPoMs bool, + logger logging.Logger, +) { + if err != nil { + logger.Log(logging.LevelDebug, "Signature verification failed") + } + + // Check if PoM found. + if state.SignedPredecisions[nodeID] != nil { + if !reflect.DeepEqual(state.SignedPredecisions[nodeID].Predecision, sp.Predecision) { + logger.Log(logging.LevelWarn, "Received conflicting signed predecisions from same node") + // if a PoM for this node has not already been sent. + if _, ok := state.HandledPoMs[nodeID]; !ok { + state.UnhandledPoMs = append(state.UnhandledPoMs, + &accpbtypes.PoM{ + NodeId: nodeID, + ConflictingMsg_1: state.SignedPredecisions[nodeID], + ConflictingMsg_2: sp, + }) + + if flushPoMs { + poms.HandlePoMs(m, mc, params, state, logger) + } + } + + logger.Log(logging.LevelDebug, "Discarding signed predecision as already received one from same node") + } + } + + // Store signed predecision. + state.SignedPredecisions[nodeID] = sp + state.PredecisionNodeIDs[string(sp.Predecision)] = append(state.PredecisionNodeIDs[string(sp.Predecision)], nodeID) + + // Once verified, if strong quorum, broadcast accpbdsl.FullCertificate. + if state.DecidedCertificate == nil && + membutil.HaveStrongQuorum(params.Membership, state.PredecisionNodeIDs[string(sp.Predecision)]) { + state.DecidedCertificate = &accpbtypes.FullCertificate{ + Decision: sp.Predecision, + Signatures: maputil.Transform( + maputil.Filter( + state.SignedPredecisions, + func( + nodeId t.NodeID, + predecision *accpbtypes.SignedPredecision, + ) bool { + return reflect.DeepEqual(predecision.Predecision, sp.Predecision) + }), + func(nodeID t.NodeID, sp *accpbtypes.SignedPredecision) (t.NodeID, []byte) { + return nodeID, sp.Signature + }, + ), + } + + // Now decision is not just the bytes, need to retrieve actual decision. + sb, err := deserializePredecision(state.DecidedCertificate.Decision) + if err != nil { + logger.Log(logging.LevelWarn, "Error deserializing predecision: %v", err) + return + } + decide(m, mc, params, state, sb, logger) + + if params.LightCertificates { + transportpbdsl.SendMessage( + m, + mc.Net, + accpbmsgs.LightCertificate(mc.Self, + sp.Predecision), + maputil.GetKeys(params.Membership.Nodes)) + } else { + transportpbdsl.SendMessage( + m, + mc.Net, + accpbmsgs.FullCertificate(mc.Self, + state.DecidedCertificate.Decision, + state.DecidedCertificate.Signatures), + maputil.GetKeys(params.Membership.Nodes)) + } + } + +} + +func decide(m dsl.Module, mc *common.ModuleConfig, params *common.ModuleParams, state *incommon.State, sb *isspbtypes.SBDeliver, logger logging.Logger) { + isspbdsl.SBDeliver(m, mc.App, sb.Sn, sb.Data, sb.Aborted, sb.Leader, sb.InstanceId) + if params.LightCertificates { + lightcertificates.ApplyLightCertificatesBuffered(m, mc, state, logger) + } +} + +func serializePredecision(sbDeliver *isspbtypes.SBDeliver) ([]byte, error) { + ser, err := getEncMode().Marshal(sbDeliver) + if err != nil { + return nil, err + } + return ser, nil +} + +func deserializePredecision(data []byte) (*isspbtypes.SBDeliver, error) { + sb := &isspbtypes.SBDeliver{} + err := cbor.Unmarshal(data, sb) + return sb, err +} + +type signRequest struct { + data []byte +} + +var encMode cbor.EncMode +var once sync.Once + +func getEncMode() cbor.EncMode { + once.Do(func() { + encMode, _ = cbor.CoreDetEncOptions().EncMode() + }) + return encMode +} diff --git a/pkg/modules/mockmodules/internal/mock_internal/impl.mock.go b/pkg/modules/mockmodules/internal/mock_internal/impl.mock.go index 273734019..1ceedfc10 100644 --- a/pkg/modules/mockmodules/internal/mock_internal/impl.mock.go +++ b/pkg/modules/mockmodules/internal/mock_internal/impl.mock.go @@ -7,9 +7,10 @@ package mock_internal import ( reflect "reflect" + gomock "github.com/golang/mock/gomock" + events "github.com/filecoin-project/mir/pkg/events" eventpb "github.com/filecoin-project/mir/pkg/pb/eventpb" - gomock "github.com/golang/mock/gomock" ) // MockModuleImpl is a mock of ModuleImpl interface. diff --git a/pkg/net/grpc/grpctransport.pb.go b/pkg/net/grpc/grpctransport.pb.go index 4d1221563..eaae1773f 100644 --- a/pkg/net/grpc/grpctransport.pb.go +++ b/pkg/net/grpc/grpctransport.pb.go @@ -5,18 +5,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: net/grpc/grpctransport.proto package grpc import ( - messagepb "github.com/filecoin-project/mir/pkg/pb/messagepb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + messagepb "github.com/filecoin-project/mir/pkg/pb/messagepb" ) const ( diff --git a/pkg/net/grpc/grpctransport_grpc.pb.go b/pkg/net/grpc/grpctransport_grpc.pb.go index ba59dbbbe..10ad5fa8a 100644 --- a/pkg/net/grpc/grpctransport_grpc.pb.go +++ b/pkg/net/grpc/grpctransport_grpc.pb.go @@ -1,9 +1,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: net/grpc/grpctransport.proto package grpc import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/pkg/pb/accountabilitypb/accountabilitypb.pb.go b/pkg/pb/accountabilitypb/accountabilitypb.pb.go new file mode 100644 index 000000000..1f3bbb355 --- /dev/null +++ b/pkg/pb/accountabilitypb/accountabilitypb.pb.go @@ -0,0 +1,709 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.12.4 +// source: accountabilitypb/accountabilitypb.proto + +package accountabilitypb + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" + _ "github.com/filecoin-project/mir/pkg/pb/net" + trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PoM struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + ConflictingMsg_1 *SignedPredecision `protobuf:"bytes,2,opt,name=conflicting_msg_1,json=conflictingMsg1,proto3" json:"conflicting_msg_1,omitempty"` + ConflictingMsg_2 *SignedPredecision `protobuf:"bytes,3,opt,name=conflicting_msg_2,json=conflictingMsg2,proto3" json:"conflicting_msg_2,omitempty"` +} + +func (x *PoM) Reset() { + *x = PoM{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PoM) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PoM) ProtoMessage() {} + +func (x *PoM) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PoM.ProtoReflect.Descriptor instead. +func (*PoM) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{0} +} + +func (x *PoM) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *PoM) GetConflictingMsg_1() *SignedPredecision { + if x != nil { + return x.ConflictingMsg_1 + } + return nil +} + +func (x *PoM) GetConflictingMsg_2() *SignedPredecision { + if x != nil { + return x.ConflictingMsg_2 + } + return nil +} + +type LightCertificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *LightCertificate) Reset() { + *x = LightCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LightCertificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LightCertificate) ProtoMessage() {} + +func (x *LightCertificate) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LightCertificate.ProtoReflect.Descriptor instead. +func (*LightCertificate) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{1} +} + +func (x *LightCertificate) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type PoMs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Poms []*PoM `protobuf:"bytes,1,rep,name=poms,proto3" json:"poms,omitempty"` +} + +func (x *PoMs) Reset() { + *x = PoMs{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PoMs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PoMs) ProtoMessage() {} + +func (x *PoMs) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PoMs.ProtoReflect.Descriptor instead. +func (*PoMs) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{2} +} + +func (x *PoMs) GetPoms() []*PoM { + if x != nil { + return x.Poms + } + return nil +} + +type Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // *Message_SignedPredecision + // *Message_Certificate + // *Message_Poms + // *Message_LightCertificate + Type isMessage_Type `protobuf_oneof:"type"` +} + +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{3} +} + +func (m *Message) GetType() isMessage_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *Message) GetSignedPredecision() *SignedPredecision { + if x, ok := x.GetType().(*Message_SignedPredecision); ok { + return x.SignedPredecision + } + return nil +} + +func (x *Message) GetCertificate() *FullCertificate { + if x, ok := x.GetType().(*Message_Certificate); ok { + return x.Certificate + } + return nil +} + +func (x *Message) GetPoms() *PoMs { + if x, ok := x.GetType().(*Message_Poms); ok { + return x.Poms + } + return nil +} + +func (x *Message) GetLightCertificate() *LightCertificate { + if x, ok := x.GetType().(*Message_LightCertificate); ok { + return x.LightCertificate + } + return nil +} + +type isMessage_Type interface { + isMessage_Type() +} + +type Message_SignedPredecision struct { + SignedPredecision *SignedPredecision `protobuf:"bytes,1,opt,name=signed_predecision,json=signedPredecision,proto3,oneof"` +} + +type Message_Certificate struct { + Certificate *FullCertificate `protobuf:"bytes,2,opt,name=certificate,proto3,oneof"` +} + +type Message_Poms struct { + Poms *PoMs `protobuf:"bytes,3,opt,name=poms,proto3,oneof"` +} + +type Message_LightCertificate struct { + LightCertificate *LightCertificate `protobuf:"bytes,4,opt,name=light_certificate,json=lightCertificate,proto3,oneof"` +} + +func (*Message_SignedPredecision) isMessage_Type() {} + +func (*Message_Certificate) isMessage_Type() {} + +func (*Message_Poms) isMessage_Type() {} + +func (*Message_LightCertificate) isMessage_Type() {} + +type SignedPredecision struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Predecision []byte `protobuf:"bytes,1,opt,name=predecision,proto3" json:"predecision,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedPredecision) Reset() { + *x = SignedPredecision{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedPredecision) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedPredecision) ProtoMessage() {} + +func (x *SignedPredecision) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedPredecision.ProtoReflect.Descriptor instead. +func (*SignedPredecision) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{4} +} + +func (x *SignedPredecision) GetPredecision() []byte { + if x != nil { + return x.Predecision + } + return nil +} + +func (x *SignedPredecision) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type FullCertificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Decision []byte `protobuf:"bytes,1,opt,name=decision,proto3" json:"decision,omitempty"` + Signatures map[string][]byte `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *FullCertificate) Reset() { + *x = FullCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FullCertificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FullCertificate) ProtoMessage() {} + +func (x *FullCertificate) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FullCertificate.ProtoReflect.Descriptor instead. +func (*FullCertificate) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{5} +} + +func (x *FullCertificate) GetDecision() []byte { + if x != nil { + return x.Decision + } + return nil +} + +func (x *FullCertificate) GetSignatures() map[string][]byte { + if x != nil { + return x.Signatures + } + return nil +} + +type InstanceParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Membership *trantorpb.Membership `protobuf:"bytes,1,opt,name=membership,proto3" json:"membership,omitempty"` + RetentionIndex uint64 `protobuf:"varint,2,opt,name=retention_index,json=retentionIndex,proto3" json:"retention_index,omitempty"` +} + +func (x *InstanceParams) Reset() { + *x = InstanceParams{} + if protoimpl.UnsafeEnabled { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstanceParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstanceParams) ProtoMessage() {} + +func (x *InstanceParams) ProtoReflect() protoreflect.Message { + mi := &file_accountabilitypb_accountabilitypb_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstanceParams.ProtoReflect.Descriptor instead. +func (*InstanceParams) Descriptor() ([]byte, []int) { + return file_accountabilitypb_accountabilitypb_proto_rawDescGZIP(), []int{6} +} + +func (x *InstanceParams) GetMembership() *trantorpb.Membership { + if x != nil { + return x.Membership + } + return nil +} + +func (x *InstanceParams) GetRetentionIndex() uint64 { + if x != nil { + return x.RetentionIndex + } + return 0 +} + +var File_accountabilitypb_accountabilitypb_proto protoreflect.FileDescriptor + +var file_accountabilitypb_accountabilitypb_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x70, 0x62, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x1a, 0x19, 0x74, 0x72, 0x61, + 0x6e, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x70, 0x62, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, + 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, + 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x03, 0x50, 0x6f, 0x4d, 0x12, 0x4d, 0x0a, 0x07, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0x82, 0xa6, 0x1d, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, + 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x44, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x11, 0x63, 0x6f, 0x6e, + 0x66, 0x6c, 0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x31, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, + 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, + 0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x73, 0x67, 0x31, 0x12, 0x4f, 0x0a, 0x11, 0x63, 0x6f, + 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x32, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, + 0x72, 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, + 0x6c, 0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x73, 0x67, 0x32, 0x3a, 0x04, 0x80, 0xa6, 0x1d, + 0x01, 0x22, 0x2c, 0x0a, 0x10, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, + 0x37, 0x0a, 0x04, 0x50, 0x6f, 0x4d, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6f, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x4d, 0x52, 0x04, 0x70, 0x6f, + 0x6d, 0x73, 0x3a, 0x04, 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0xbb, 0x02, 0x0a, 0x07, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x54, 0x0a, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, + 0x72, 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x65, 0x64, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, + 0x72, 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x70, 0x62, 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x4d, 0x73, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6d, 0x73, 0x12, + 0x51, 0x0a, 0x11, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x00, + 0x52, 0x10, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x3a, 0x04, 0xc8, 0xe4, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x04, 0xc8, 0xe4, 0x1d, 0x01, 0x22, 0x5d, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x50, 0x72, 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x70, 0x72, 0x65, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x08, 0xd0, 0xe4, 0x1d, + 0x01, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0xfc, 0x01, 0x0a, 0x0f, 0x46, 0x75, 0x6c, 0x6c, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x64, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x46, 0x75, + 0x6c, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x34, 0xaa, + 0xa6, 0x1d, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, + 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, + 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x44, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x1a, + 0x3d, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x04, + 0xd0, 0xe4, 0x1d, 0x01, 0x22, 0xbc, 0x01, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x35, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x72, + 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, + 0x69, 0x70, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x6d, + 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, + 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, 0x80, + 0xa6, 0x1d, 0x01, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_accountabilitypb_accountabilitypb_proto_rawDescOnce sync.Once + file_accountabilitypb_accountabilitypb_proto_rawDescData = file_accountabilitypb_accountabilitypb_proto_rawDesc +) + +func file_accountabilitypb_accountabilitypb_proto_rawDescGZIP() []byte { + file_accountabilitypb_accountabilitypb_proto_rawDescOnce.Do(func() { + file_accountabilitypb_accountabilitypb_proto_rawDescData = protoimpl.X.CompressGZIP(file_accountabilitypb_accountabilitypb_proto_rawDescData) + }) + return file_accountabilitypb_accountabilitypb_proto_rawDescData +} + +var file_accountabilitypb_accountabilitypb_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_accountabilitypb_accountabilitypb_proto_goTypes = []interface{}{ + (*PoM)(nil), // 0: accountabilitypb.PoM + (*LightCertificate)(nil), // 1: accountabilitypb.LightCertificate + (*PoMs)(nil), // 2: accountabilitypb.PoMs + (*Message)(nil), // 3: accountabilitypb.Message + (*SignedPredecision)(nil), // 4: accountabilitypb.SignedPredecision + (*FullCertificate)(nil), // 5: accountabilitypb.FullCertificate + (*InstanceParams)(nil), // 6: accountabilitypb.InstanceParams + nil, // 7: accountabilitypb.FullCertificate.SignaturesEntry + (*trantorpb.Membership)(nil), // 8: trantorpb.Membership +} +var file_accountabilitypb_accountabilitypb_proto_depIdxs = []int32{ + 4, // 0: accountabilitypb.PoM.conflicting_msg_1:type_name -> accountabilitypb.SignedPredecision + 4, // 1: accountabilitypb.PoM.conflicting_msg_2:type_name -> accountabilitypb.SignedPredecision + 0, // 2: accountabilitypb.PoMs.poms:type_name -> accountabilitypb.PoM + 4, // 3: accountabilitypb.Message.signed_predecision:type_name -> accountabilitypb.SignedPredecision + 5, // 4: accountabilitypb.Message.certificate:type_name -> accountabilitypb.FullCertificate + 2, // 5: accountabilitypb.Message.poms:type_name -> accountabilitypb.PoMs + 1, // 6: accountabilitypb.Message.light_certificate:type_name -> accountabilitypb.LightCertificate + 7, // 7: accountabilitypb.FullCertificate.signatures:type_name -> accountabilitypb.FullCertificate.SignaturesEntry + 8, // 8: accountabilitypb.InstanceParams.membership:type_name -> trantorpb.Membership + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_accountabilitypb_accountabilitypb_proto_init() } +func file_accountabilitypb_accountabilitypb_proto_init() { + if File_accountabilitypb_accountabilitypb_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_accountabilitypb_accountabilitypb_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PoM); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LightCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PoMs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedPredecision); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FullCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstanceParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_accountabilitypb_accountabilitypb_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Message_SignedPredecision)(nil), + (*Message_Certificate)(nil), + (*Message_Poms)(nil), + (*Message_LightCertificate)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_accountabilitypb_accountabilitypb_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_accountabilitypb_accountabilitypb_proto_goTypes, + DependencyIndexes: file_accountabilitypb_accountabilitypb_proto_depIdxs, + MessageInfos: file_accountabilitypb_accountabilitypb_proto_msgTypes, + }.Build() + File_accountabilitypb_accountabilitypb_proto = out.File + file_accountabilitypb_accountabilitypb_proto_rawDesc = nil + file_accountabilitypb_accountabilitypb_proto_goTypes = nil + file_accountabilitypb_accountabilitypb_proto_depIdxs = nil +} diff --git a/pkg/pb/accountabilitypb/accountabilitypb.pb.mir.go b/pkg/pb/accountabilitypb/accountabilitypb.pb.mir.go new file mode 100644 index 000000000..fcd922fa0 --- /dev/null +++ b/pkg/pb/accountabilitypb/accountabilitypb.pb.mir.go @@ -0,0 +1,16 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package accountabilitypb + +import ( + reflect "reflect" +) + +func (*Message) ReflectTypeOptions() []reflect.Type { + return []reflect.Type{ + reflect.TypeOf((*Message_SignedPredecision)(nil)), + reflect.TypeOf((*Message_Certificate)(nil)), + reflect.TypeOf((*Message_Poms)(nil)), + reflect.TypeOf((*Message_LightCertificate)(nil)), + } +} diff --git a/pkg/pb/accountabilitypb/dsl/messages.mir.go b/pkg/pb/accountabilitypb/dsl/messages.mir.go new file mode 100644 index 000000000..7f74c952b --- /dev/null +++ b/pkg/pb/accountabilitypb/dsl/messages.mir.go @@ -0,0 +1,48 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package accountabilitypbdsl + +import ( + dsl "github.com/filecoin-project/mir/pkg/dsl" + types "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + dsl1 "github.com/filecoin-project/mir/pkg/pb/messagepb/dsl" + types2 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" + types1 "github.com/filecoin-project/mir/pkg/types" +) + +// Module-specific dsl functions for processing net messages. + +func UponMessageReceived[W types.Message_TypeWrapper[M], M any](m dsl.Module, handler func(from types1.NodeID, msg *M) error) { + dsl1.UponMessageReceived[*types2.Message_Accountability](m, func(from types1.NodeID, msg *types.Message) error { + w, ok := msg.Type.(W) + if !ok { + return nil + } + + return handler(from, w.Unwrap()) + }) +} + +func UponSignedPredecisionReceived(m dsl.Module, handler func(from types1.NodeID, predecision []uint8, signature []uint8) error) { + UponMessageReceived[*types.Message_SignedPredecision](m, func(from types1.NodeID, msg *types.SignedPredecision) error { + return handler(from, msg.Predecision, msg.Signature) + }) +} + +func UponFullCertificateReceived(m dsl.Module, handler func(from types1.NodeID, decision []uint8, signatures map[types1.NodeID][]uint8) error) { + UponMessageReceived[*types.Message_Certificate](m, func(from types1.NodeID, msg *types.FullCertificate) error { + return handler(from, msg.Decision, msg.Signatures) + }) +} + +func UponPoMsReceived(m dsl.Module, handler func(from types1.NodeID, poms []*types.PoM) error) { + UponMessageReceived[*types.Message_Poms](m, func(from types1.NodeID, msg *types.PoMs) error { + return handler(from, msg.Poms) + }) +} + +func UponLightCertificateReceived(m dsl.Module, handler func(from types1.NodeID, data []uint8) error) { + UponMessageReceived[*types.Message_LightCertificate](m, func(from types1.NodeID, msg *types.LightCertificate) error { + return handler(from, msg.Data) + }) +} diff --git a/pkg/pb/accountabilitypb/msgs/msgs.mir.go b/pkg/pb/accountabilitypb/msgs/msgs.mir.go new file mode 100644 index 000000000..d48c1e6b3 --- /dev/null +++ b/pkg/pb/accountabilitypb/msgs/msgs.mir.go @@ -0,0 +1,71 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package accountabilitypbmsgs + +import ( + types2 "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" + types1 "github.com/filecoin-project/mir/pkg/pb/messagepb/types" + types "github.com/filecoin-project/mir/pkg/types" +) + +func SignedPredecision(destModule types.ModuleID, predecision []uint8, signature []uint8) *types1.Message { + return &types1.Message{ + DestModule: destModule, + Type: &types1.Message_Accountability{ + Accountability: &types2.Message{ + Type: &types2.Message_SignedPredecision{ + SignedPredecision: &types2.SignedPredecision{ + Predecision: predecision, + Signature: signature, + }, + }, + }, + }, + } +} + +func FullCertificate(destModule types.ModuleID, decision []uint8, signatures map[types.NodeID][]uint8) *types1.Message { + return &types1.Message{ + DestModule: destModule, + Type: &types1.Message_Accountability{ + Accountability: &types2.Message{ + Type: &types2.Message_Certificate{ + Certificate: &types2.FullCertificate{ + Decision: decision, + Signatures: signatures, + }, + }, + }, + }, + } +} + +func PoMs(destModule types.ModuleID, poms []*types2.PoM) *types1.Message { + return &types1.Message{ + DestModule: destModule, + Type: &types1.Message_Accountability{ + Accountability: &types2.Message{ + Type: &types2.Message_Poms{ + Poms: &types2.PoMs{ + Poms: poms, + }, + }, + }, + }, + } +} + +func LightCertificate(destModule types.ModuleID, data []uint8) *types1.Message { + return &types1.Message{ + DestModule: destModule, + Type: &types1.Message_Accountability{ + Accountability: &types2.Message{ + Type: &types2.Message_LightCertificate{ + LightCertificate: &types2.LightCertificate{ + Data: data, + }, + }, + }, + }, + } +} diff --git a/pkg/pb/accountabilitypb/oneof_interfaces.mir.go b/pkg/pb/accountabilitypb/oneof_interfaces.mir.go new file mode 100644 index 000000000..df9bf3f65 --- /dev/null +++ b/pkg/pb/accountabilitypb/oneof_interfaces.mir.go @@ -0,0 +1,26 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package accountabilitypb + +type Message_Type = isMessage_Type + +type Message_TypeWrapper[T any] interface { + Message_Type + Unwrap() *T +} + +func (w *Message_SignedPredecision) Unwrap() *SignedPredecision { + return w.SignedPredecision +} + +func (w *Message_Certificate) Unwrap() *FullCertificate { + return w.Certificate +} + +func (w *Message_Poms) Unwrap() *PoMs { + return w.Poms +} + +func (w *Message_LightCertificate) Unwrap() *LightCertificate { + return w.LightCertificate +} diff --git a/pkg/pb/accountabilitypb/types/types.mir.go b/pkg/pb/accountabilitypb/types/types.mir.go new file mode 100644 index 000000000..c524002bf --- /dev/null +++ b/pkg/pb/accountabilitypb/types/types.mir.go @@ -0,0 +1,371 @@ +// Code generated by Mir codegen. DO NOT EDIT. + +package accountabilitypbtypes + +import ( + mirreflect "github.com/filecoin-project/mir/codegen/mirreflect" + types1 "github.com/filecoin-project/mir/codegen/model/types" + accountabilitypb "github.com/filecoin-project/mir/pkg/pb/accountabilitypb" + types2 "github.com/filecoin-project/mir/pkg/pb/trantorpb/types" + types3 "github.com/filecoin-project/mir/pkg/trantor/types" + types "github.com/filecoin-project/mir/pkg/types" + reflectutil "github.com/filecoin-project/mir/pkg/util/reflectutil" +) + +type PoM struct { + NodeId types.NodeID + ConflictingMsg_1 *SignedPredecision + ConflictingMsg_2 *SignedPredecision +} + +func PoMFromPb(pb *accountabilitypb.PoM) *PoM { + if pb == nil { + return nil + } + return &PoM{ + NodeId: (types.NodeID)(pb.NodeId), + ConflictingMsg_1: SignedPredecisionFromPb(pb.ConflictingMsg_1), + ConflictingMsg_2: SignedPredecisionFromPb(pb.ConflictingMsg_2), + } +} + +func (m *PoM) Pb() *accountabilitypb.PoM { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.PoM{} + { + pbMessage.NodeId = (string)(m.NodeId) + if m.ConflictingMsg_1 != nil { + pbMessage.ConflictingMsg_1 = (m.ConflictingMsg_1).Pb() + } + if m.ConflictingMsg_2 != nil { + pbMessage.ConflictingMsg_2 = (m.ConflictingMsg_2).Pb() + } + } + + return pbMessage +} + +func (*PoM) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.PoM]()} +} + +type LightCertificate struct { + Data []uint8 +} + +func LightCertificateFromPb(pb *accountabilitypb.LightCertificate) *LightCertificate { + if pb == nil { + return nil + } + return &LightCertificate{ + Data: pb.Data, + } +} + +func (m *LightCertificate) Pb() *accountabilitypb.LightCertificate { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.LightCertificate{} + { + pbMessage.Data = m.Data + } + + return pbMessage +} + +func (*LightCertificate) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.LightCertificate]()} +} + +type PoMs struct { + Poms []*PoM +} + +func PoMsFromPb(pb *accountabilitypb.PoMs) *PoMs { + if pb == nil { + return nil + } + return &PoMs{ + Poms: types1.ConvertSlice(pb.Poms, func(t *accountabilitypb.PoM) *PoM { + return PoMFromPb(t) + }), + } +} + +func (m *PoMs) Pb() *accountabilitypb.PoMs { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.PoMs{} + { + pbMessage.Poms = types1.ConvertSlice(m.Poms, func(t *PoM) *accountabilitypb.PoM { + return (t).Pb() + }) + } + + return pbMessage +} + +func (*PoMs) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.PoMs]()} +} + +type Message struct { + Type Message_Type +} + +type Message_Type interface { + mirreflect.GeneratedType + isMessage_Type() + Pb() accountabilitypb.Message_Type +} + +type Message_TypeWrapper[T any] interface { + Message_Type + Unwrap() *T +} + +func Message_TypeFromPb(pb accountabilitypb.Message_Type) Message_Type { + if pb == nil { + return nil + } + switch pb := pb.(type) { + case *accountabilitypb.Message_SignedPredecision: + return &Message_SignedPredecision{SignedPredecision: SignedPredecisionFromPb(pb.SignedPredecision)} + case *accountabilitypb.Message_Certificate: + return &Message_Certificate{Certificate: FullCertificateFromPb(pb.Certificate)} + case *accountabilitypb.Message_Poms: + return &Message_Poms{Poms: PoMsFromPb(pb.Poms)} + case *accountabilitypb.Message_LightCertificate: + return &Message_LightCertificate{LightCertificate: LightCertificateFromPb(pb.LightCertificate)} + } + return nil +} + +type Message_SignedPredecision struct { + SignedPredecision *SignedPredecision +} + +func (*Message_SignedPredecision) isMessage_Type() {} + +func (w *Message_SignedPredecision) Unwrap() *SignedPredecision { + return w.SignedPredecision +} + +func (w *Message_SignedPredecision) Pb() accountabilitypb.Message_Type { + if w == nil { + return nil + } + if w.SignedPredecision == nil { + return &accountabilitypb.Message_SignedPredecision{} + } + return &accountabilitypb.Message_SignedPredecision{SignedPredecision: (w.SignedPredecision).Pb()} +} + +func (*Message_SignedPredecision) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.Message_SignedPredecision]()} +} + +type Message_Certificate struct { + Certificate *FullCertificate +} + +func (*Message_Certificate) isMessage_Type() {} + +func (w *Message_Certificate) Unwrap() *FullCertificate { + return w.Certificate +} + +func (w *Message_Certificate) Pb() accountabilitypb.Message_Type { + if w == nil { + return nil + } + if w.Certificate == nil { + return &accountabilitypb.Message_Certificate{} + } + return &accountabilitypb.Message_Certificate{Certificate: (w.Certificate).Pb()} +} + +func (*Message_Certificate) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.Message_Certificate]()} +} + +type Message_Poms struct { + Poms *PoMs +} + +func (*Message_Poms) isMessage_Type() {} + +func (w *Message_Poms) Unwrap() *PoMs { + return w.Poms +} + +func (w *Message_Poms) Pb() accountabilitypb.Message_Type { + if w == nil { + return nil + } + if w.Poms == nil { + return &accountabilitypb.Message_Poms{} + } + return &accountabilitypb.Message_Poms{Poms: (w.Poms).Pb()} +} + +func (*Message_Poms) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.Message_Poms]()} +} + +type Message_LightCertificate struct { + LightCertificate *LightCertificate +} + +func (*Message_LightCertificate) isMessage_Type() {} + +func (w *Message_LightCertificate) Unwrap() *LightCertificate { + return w.LightCertificate +} + +func (w *Message_LightCertificate) Pb() accountabilitypb.Message_Type { + if w == nil { + return nil + } + if w.LightCertificate == nil { + return &accountabilitypb.Message_LightCertificate{} + } + return &accountabilitypb.Message_LightCertificate{LightCertificate: (w.LightCertificate).Pb()} +} + +func (*Message_LightCertificate) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.Message_LightCertificate]()} +} + +func MessageFromPb(pb *accountabilitypb.Message) *Message { + if pb == nil { + return nil + } + return &Message{ + Type: Message_TypeFromPb(pb.Type), + } +} + +func (m *Message) Pb() *accountabilitypb.Message { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.Message{} + { + if m.Type != nil { + pbMessage.Type = (m.Type).Pb() + } + } + + return pbMessage +} + +func (*Message) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.Message]()} +} + +type SignedPredecision struct { + Predecision []uint8 + Signature []uint8 +} + +func SignedPredecisionFromPb(pb *accountabilitypb.SignedPredecision) *SignedPredecision { + if pb == nil { + return nil + } + return &SignedPredecision{ + Predecision: pb.Predecision, + Signature: pb.Signature, + } +} + +func (m *SignedPredecision) Pb() *accountabilitypb.SignedPredecision { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.SignedPredecision{} + { + pbMessage.Predecision = m.Predecision + pbMessage.Signature = m.Signature + } + + return pbMessage +} + +func (*SignedPredecision) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.SignedPredecision]()} +} + +type FullCertificate struct { + Decision []uint8 + Signatures map[types.NodeID][]uint8 +} + +func FullCertificateFromPb(pb *accountabilitypb.FullCertificate) *FullCertificate { + if pb == nil { + return nil + } + return &FullCertificate{ + Decision: pb.Decision, + Signatures: types1.ConvertMap(pb.Signatures, func(k string, v []uint8) (types.NodeID, []uint8) { + return (types.NodeID)(k), v + }), + } +} + +func (m *FullCertificate) Pb() *accountabilitypb.FullCertificate { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.FullCertificate{} + { + pbMessage.Decision = m.Decision + pbMessage.Signatures = types1.ConvertMap(m.Signatures, func(k types.NodeID, v []uint8) (string, []uint8) { + return (string)(k), v + }) + } + + return pbMessage +} + +func (*FullCertificate) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.FullCertificate]()} +} + +type InstanceParams struct { + Membership *types2.Membership + RetentionIndex types3.RetentionIndex +} + +func InstanceParamsFromPb(pb *accountabilitypb.InstanceParams) *InstanceParams { + if pb == nil { + return nil + } + return &InstanceParams{ + Membership: types2.MembershipFromPb(pb.Membership), + RetentionIndex: (types3.RetentionIndex)(pb.RetentionIndex), + } +} + +func (m *InstanceParams) Pb() *accountabilitypb.InstanceParams { + if m == nil { + return nil + } + pbMessage := &accountabilitypb.InstanceParams{} + { + if m.Membership != nil { + pbMessage.Membership = (m.Membership).Pb() + } + pbMessage.RetentionIndex = (uint64)(m.RetentionIndex) + } + + return pbMessage +} + +func (*InstanceParams) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*accountabilitypb.InstanceParams]()} +} diff --git a/pkg/pb/apppb/apppb.pb.go b/pkg/pb/apppb/apppb.pb.go index e06601992..890b6ac6b 100644 --- a/pkg/pb/apppb/apppb.pb.go +++ b/pkg/pb/apppb/apppb.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: apppb/apppb.proto package apppb import ( - checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" - _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" + _ "github.com/filecoin-project/mir/pkg/pb/mir" ) const ( diff --git a/pkg/pb/availabilitypb/availabilitypb.pb.go b/pkg/pb/availabilitypb/availabilitypb.pb.go index 28985f452..acb443bcf 100644 --- a/pkg/pb/availabilitypb/availabilitypb.pb.go +++ b/pkg/pb/availabilitypb/availabilitypb.pb.go @@ -1,21 +1,23 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: availabilitypb/availabilitypb.proto package availabilitypb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go b/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go index 1aeb34ad7..1e74eb5ac 100644 --- a/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go +++ b/pkg/pb/availabilitypb/batchdbpb/batchdbpb.pb.go @@ -1,20 +1,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: availabilitypb/batchdbpb/batchdbpb.proto package batchdbpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/availabilitypb/mscpb/mscpb.pb.go b/pkg/pb/availabilitypb/mscpb/mscpb.pb.go index b12d59ada..dc48e55d3 100644 --- a/pkg/pb/availabilitypb/mscpb/mscpb.pb.go +++ b/pkg/pb/availabilitypb/mscpb/mscpb.pb.go @@ -1,19 +1,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: availabilitypb/mscpb/mscpb.proto package mscpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "github.com/filecoin-project/mir/pkg/pb/mir" _ "github.com/filecoin-project/mir/pkg/pb/net" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go b/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go index f67eaeecf..93c4321e6 100644 --- a/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go +++ b/pkg/pb/batchfetcherpb/batchfetcherpb.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: batchfetcherpb/batchfetcherpb.proto package batchfetcherpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" + trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" ) const ( diff --git a/pkg/pb/bcbpb/bcbpb.pb.go b/pkg/pb/bcbpb/bcbpb.pb.go index 67620e1e8..0938361cd 100644 --- a/pkg/pb/bcbpb/bcbpb.pb.go +++ b/pkg/pb/bcbpb/bcbpb.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: bcbpb/bcbpb.proto package bcbpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - _ "github.com/filecoin-project/mir/pkg/pb/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" + _ "github.com/filecoin-project/mir/pkg/pb/net" ) const ( diff --git a/pkg/pb/checkpointpb/checkpointpb.pb.go b/pkg/pb/checkpointpb/checkpointpb.pb.go index c3e6da9de..1a05fd76d 100644 --- a/pkg/pb/checkpointpb/checkpointpb.pb.go +++ b/pkg/pb/checkpointpb/checkpointpb.pb.go @@ -1,19 +1,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: checkpointpb/checkpointpb.proto package checkpointpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "github.com/filecoin-project/mir/pkg/pb/mir" _ "github.com/filecoin-project/mir/pkg/pb/net" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go b/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go index a3347588f..54c209b94 100644 --- a/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go +++ b/pkg/pb/checkpointpb/chkpvalidatorpb/chkpvalidatorpb.pb.go @@ -1,21 +1,23 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: checkpointpb/chkpvalidatorpb/chkpvalidatorpb.proto package chkpvalidatorpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/contextstorepb/contextstorepb.pb.go b/pkg/pb/contextstorepb/contextstorepb.pb.go index 91d4deb90..74aaeecbd 100644 --- a/pkg/pb/contextstorepb/contextstorepb.pb.go +++ b/pkg/pb/contextstorepb/contextstorepb.pb.go @@ -1,17 +1,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: contextstorepb/contextstorepb.proto package contextstorepb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" ) const ( diff --git a/pkg/pb/cryptopb/cryptopb.pb.go b/pkg/pb/cryptopb/cryptopb.pb.go index 8c1406f2f..754f1b834 100644 --- a/pkg/pb/cryptopb/cryptopb.pb.go +++ b/pkg/pb/cryptopb/cryptopb.pb.go @@ -1,19 +1,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: cryptopb/cryptopb.proto package cryptopb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/dslpb/dslpb.pb.go b/pkg/pb/dslpb/dslpb.pb.go index 9080eddbb..9878f48f0 100644 --- a/pkg/pb/dslpb/dslpb.pb.go +++ b/pkg/pb/dslpb/dslpb.pb.go @@ -1,17 +1,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: dslpb/dslpb.proto package dslpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" ) const ( diff --git a/pkg/pb/eventpb/eventpb.pb.go b/pkg/pb/eventpb/eventpb.pb.go index 4fbd16948..c663c41ec 100644 --- a/pkg/pb/eventpb/eventpb.pb.go +++ b/pkg/pb/eventpb/eventpb.pb.go @@ -1,12 +1,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: eventpb/eventpb.proto package eventpb import ( + reflect "reflect" + sync "sync" + + wrappers "github.com/golang/protobuf/ptypes/wrappers" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + apppb "github.com/filecoin-project/mir/pkg/pb/apppb" availabilitypb "github.com/filecoin-project/mir/pkg/pb/availabilitypb" batchdbpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/batchdbpb" @@ -26,11 +33,6 @@ import ( testerpb "github.com/filecoin-project/mir/pkg/pb/testerpb" threshcryptopb "github.com/filecoin-project/mir/pkg/pb/threshcryptopb" transportpb "github.com/filecoin-project/mir/pkg/pb/transportpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - reflect "reflect" - sync "sync" ) const ( @@ -260,14 +262,14 @@ func (x *Event) GetPingPong() *pingpongpb.Event { return nil } -func (x *Event) GetTestingString() *wrapperspb.StringValue { +func (x *Event) GetTestingString() *wrappers.StringValue { if x, ok := x.GetType().(*Event_TestingString); ok { return x.TestingString } return nil } -func (x *Event) GetTestingUint() *wrapperspb.UInt64Value { +func (x *Event) GetTestingUint() *wrappers.UInt64Value { if x, ok := x.GetType().(*Event_TestingUint); ok { return x.TestingUint } @@ -374,11 +376,11 @@ type Event_PingPong struct { type Event_TestingString struct { // for unit-tests - TestingString *wrapperspb.StringValue `protobuf:"bytes,301,opt,name=testingString,proto3,oneof"` + TestingString *wrappers.StringValue `protobuf:"bytes,301,opt,name=testingString,proto3,oneof"` } type Event_TestingUint struct { - TestingUint *wrapperspb.UInt64Value `protobuf:"bytes,302,opt,name=testingUint,proto3,oneof"` + TestingUint *wrappers.UInt64Value `protobuf:"bytes,302,opt,name=testingUint,proto3,oneof"` } type Event_Tester struct { @@ -944,8 +946,8 @@ var file_eventpb_eventpb_proto_goTypes = []interface{}{ (*chkpvalidatorpb.Event)(nil), // 20: chkpvalidatorpb.Event (*pprepvalidatorpb.Event)(nil), // 21: pprepvalidatorpb.Event (*pingpongpb.Event)(nil), // 22: pingpongpb.Event - (*wrapperspb.StringValue)(nil), // 23: google.protobuf.StringValue - (*wrapperspb.UInt64Value)(nil), // 24: google.protobuf.UInt64Value + (*wrappers.StringValue)(nil), // 23: google.protobuf.StringValue + (*wrappers.UInt64Value)(nil), // 24: google.protobuf.UInt64Value (*testerpb.Tester)(nil), // 25: testerpb.Tester } var file_eventpb_eventpb_proto_depIdxs = []int32{ diff --git a/pkg/pb/eventpb/oneof_interfaces.mir.go b/pkg/pb/eventpb/oneof_interfaces.mir.go index 2baab82b9..c33cd9e75 100644 --- a/pkg/pb/eventpb/oneof_interfaces.mir.go +++ b/pkg/pb/eventpb/oneof_interfaces.mir.go @@ -3,6 +3,8 @@ package eventpb import ( + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + apppb "github.com/filecoin-project/mir/pkg/pb/apppb" availabilitypb "github.com/filecoin-project/mir/pkg/pb/availabilitypb" batchdbpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/batchdbpb" @@ -21,7 +23,6 @@ import ( testerpb "github.com/filecoin-project/mir/pkg/pb/testerpb" threshcryptopb "github.com/filecoin-project/mir/pkg/pb/threshcryptopb" transportpb "github.com/filecoin-project/mir/pkg/pb/transportpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" ) type Event_Type = isEvent_Type diff --git a/pkg/pb/eventpb/types/types.mir.go b/pkg/pb/eventpb/types/types.mir.go index 119300d27..37c95a225 100644 --- a/pkg/pb/eventpb/types/types.mir.go +++ b/pkg/pb/eventpb/types/types.mir.go @@ -3,6 +3,8 @@ package eventpbtypes import ( + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + mirreflect "github.com/filecoin-project/mir/codegen/mirreflect" types19 "github.com/filecoin-project/mir/codegen/model/types" types13 "github.com/filecoin-project/mir/pkg/pb/apppb/types" @@ -28,7 +30,6 @@ import ( types21 "github.com/filecoin-project/mir/pkg/trantor/types" types "github.com/filecoin-project/mir/pkg/types" reflectutil "github.com/filecoin-project/mir/pkg/util/reflectutil" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" ) type Event struct { diff --git a/pkg/pb/factorypb/factorypb.pb.go b/pkg/pb/factorypb/factorypb.pb.go index a0bed354d..14a65f541 100644 --- a/pkg/pb/factorypb/factorypb.pb.go +++ b/pkg/pb/factorypb/factorypb.pb.go @@ -1,21 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: factorypb/factorypb.proto package factorypb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + accountabilitypb "github.com/filecoin-project/mir/pkg/pb/accountabilitypb" mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" ordererpb "github.com/filecoin-project/mir/pkg/pb/ordererpb" pprepvalidatorpb "github.com/filecoin-project/mir/pkg/pb/ordererpb/pprepvalidatorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -232,6 +235,7 @@ type GeneratorParams struct { // *GeneratorParams_EchoTestModule // *GeneratorParams_PbftModule // *GeneratorParams_PpvModule + // *GeneratorParams_AccModule Type isGeneratorParams_Type `protobuf_oneof:"type"` } @@ -309,6 +313,13 @@ func (x *GeneratorParams) GetPpvModule() *pprepvalidatorpb.PPrepValidatorChkp { return nil } +func (x *GeneratorParams) GetAccModule() *accountabilitypb.InstanceParams { + if x, ok := x.GetType().(*GeneratorParams_AccModule); ok { + return x.AccModule + } + return nil +} + type isGeneratorParams_Type interface { isGeneratorParams_Type() } @@ -333,6 +344,10 @@ type GeneratorParams_PpvModule struct { PpvModule *pprepvalidatorpb.PPrepValidatorChkp `protobuf:"bytes,5,opt,name=ppv_module,json=ppvModule,proto3,oneof"` } +type GeneratorParams_AccModule struct { + AccModule *accountabilitypb.InstanceParams `protobuf:"bytes,6,opt,name=acc_module,json=accModule,proto3,oneof"` +} + func (*GeneratorParams_MultisigCollector) isGeneratorParams_Type() {} func (*GeneratorParams_Checkpoint) isGeneratorParams_Type() {} @@ -343,6 +358,8 @@ func (*GeneratorParams_PbftModule) isGeneratorParams_Type() {} func (*GeneratorParams_PpvModule) isGeneratorParams_Type() {} +func (*GeneratorParams_AccModule) isGeneratorParams_Type() {} + // Used only for unit tests. type EchoModuleParams struct { state protoimpl.MessageState @@ -405,75 +422,82 @@ var file_factorypb_factorypb_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2f, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, - 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x35, 0x0a, 0x0a, 0x6e, 0x65, 0x77, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, - 0x4e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x65, 0x77, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, - 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, 0x61, 0x72, 0x62, - 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x61, - 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x3a, 0x04, 0x90, 0xa6, - 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, - 0x22, 0x89, 0x02, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x53, - 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x36, 0x82, 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, + 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x6e, 0x65, 0x77, 0x5f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x66, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, + 0x44, 0x0a, 0x0f, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x3a, 0x04, 0x90, 0xa6, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x22, 0x89, 0x02, 0x0a, 0x09, 0x4e, 0x65, + 0x77, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x53, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0x82, 0xa6, 0x1d, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, + 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x49, 0x44, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x6d, 0x0a, 0x0f, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, + 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, + 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x49, 0x64, 0x12, 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, - 0x1d, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, - 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, - 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x32, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x85, 0x01, 0x0a, - 0x0e, 0x47, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x12, - 0x6d, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x44, 0x82, 0xa6, 0x1d, 0x40, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, - 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, - 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, - 0x98, 0xa6, 0x1d, 0x01, 0x22, 0x80, 0x03, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x55, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, - 0x69, 0x73, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x6d, 0x73, 0x63, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x75, - 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, - 0x3e, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x47, 0x0a, 0x10, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0e, 0x65, 0x63, 0x68, 0x6f, 0x54, 0x65, - 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x62, 0x66, 0x74, - 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x42, 0x46, 0x54, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x62, 0x66, 0x74, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x70, 0x70, 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x50, 0x72, 0x65, 0x70, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x68, 0x6b, 0x70, 0x48, 0x00, 0x52, 0x09, - 0x70, 0x70, 0x76, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, - 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x30, 0x0a, 0x10, 0x45, 0x63, 0x68, 0x6f, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, - 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x70, 0x62, 0x2f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x74, + 0x6f, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x04, 0x98, 0xa6, 0x1d, 0x01, 0x22, 0xc3, 0x03, + 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x55, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x5f, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x6d, + 0x73, 0x63, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, + 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x10, 0x65, 0x63, 0x68, 0x6f, + 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x2e, 0x45, + 0x63, 0x68, 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, + 0x00, 0x52, 0x0e, 0x65, 0x63, 0x68, 0x6f, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x62, 0x66, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x70, 0x62, 0x2e, 0x50, 0x42, 0x46, 0x54, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, + 0x0a, 0x70, 0x62, 0x66, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x70, + 0x70, 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x70, 0x70, 0x72, 0x65, 0x70, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x70, 0x62, 0x2e, 0x50, 0x50, 0x72, 0x65, 0x70, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x43, 0x68, 0x6b, 0x70, 0x48, 0x00, 0x52, 0x09, 0x70, 0x70, 0x76, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x48, 0x00, 0x52, 0x09, 0x61, 0x63, 0x63, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x22, 0x30, 0x0a, 0x10, 0x45, 0x63, 0x68, 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x3a, + 0x04, 0x80, 0xa6, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, + 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -499,6 +523,7 @@ var file_factorypb_factorypb_proto_goTypes = []interface{}{ (*checkpointpb.InstanceParams)(nil), // 6: checkpointpb.InstanceParams (*ordererpb.PBFTModule)(nil), // 7: ordererpb.PBFTModule (*pprepvalidatorpb.PPrepValidatorChkp)(nil), // 8: pprepvalidatorpb.PPrepValidatorChkp + (*accountabilitypb.InstanceParams)(nil), // 9: accountabilitypb.InstanceParams } var file_factorypb_factorypb_proto_depIdxs = []int32{ 1, // 0: factorypb.Event.new_module:type_name -> factorypb.NewModule @@ -509,11 +534,12 @@ var file_factorypb_factorypb_proto_depIdxs = []int32{ 4, // 5: factorypb.GeneratorParams.echo_test_module:type_name -> factorypb.EchoModuleParams 7, // 6: factorypb.GeneratorParams.pbft_module:type_name -> ordererpb.PBFTModule 8, // 7: factorypb.GeneratorParams.ppv_module:type_name -> pprepvalidatorpb.PPrepValidatorChkp - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 9, // 8: factorypb.GeneratorParams.acc_module:type_name -> accountabilitypb.InstanceParams + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_factorypb_factorypb_proto_init() } @@ -593,6 +619,7 @@ func file_factorypb_factorypb_proto_init() { (*GeneratorParams_EchoTestModule)(nil), (*GeneratorParams_PbftModule)(nil), (*GeneratorParams_PpvModule)(nil), + (*GeneratorParams_AccModule)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/pkg/pb/factorypb/factorypb.pb.mir.go b/pkg/pb/factorypb/factorypb.pb.mir.go index e73319962..2e927544b 100644 --- a/pkg/pb/factorypb/factorypb.pb.mir.go +++ b/pkg/pb/factorypb/factorypb.pb.mir.go @@ -20,5 +20,6 @@ func (*GeneratorParams) ReflectTypeOptions() []reflect.Type { reflect.TypeOf((*GeneratorParams_EchoTestModule)(nil)), reflect.TypeOf((*GeneratorParams_PbftModule)(nil)), reflect.TypeOf((*GeneratorParams_PpvModule)(nil)), + reflect.TypeOf((*GeneratorParams_AccModule)(nil)), } } diff --git a/pkg/pb/factorypb/oneof_interfaces.mir.go b/pkg/pb/factorypb/oneof_interfaces.mir.go index 5967ac202..3fa582fe6 100644 --- a/pkg/pb/factorypb/oneof_interfaces.mir.go +++ b/pkg/pb/factorypb/oneof_interfaces.mir.go @@ -3,6 +3,7 @@ package factorypb import ( + accountabilitypb "github.com/filecoin-project/mir/pkg/pb/accountabilitypb" mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" ordererpb "github.com/filecoin-project/mir/pkg/pb/ordererpb" @@ -50,3 +51,7 @@ func (w *GeneratorParams_PbftModule) Unwrap() *ordererpb.PBFTModule { func (w *GeneratorParams_PpvModule) Unwrap() *pprepvalidatorpb.PPrepValidatorChkp { return w.PpvModule } + +func (w *GeneratorParams_AccModule) Unwrap() *accountabilitypb.InstanceParams { + return w.AccModule +} diff --git a/pkg/pb/factorypb/types/types.mir.go b/pkg/pb/factorypb/types/types.mir.go index 4c33268f9..f1b5c69d0 100644 --- a/pkg/pb/factorypb/types/types.mir.go +++ b/pkg/pb/factorypb/types/types.mir.go @@ -4,6 +4,7 @@ package factorypbtypes import ( mirreflect "github.com/filecoin-project/mir/codegen/mirreflect" + types6 "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" types2 "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb/types" types3 "github.com/filecoin-project/mir/pkg/pb/checkpointpb/types" factorypb "github.com/filecoin-project/mir/pkg/pb/factorypb" @@ -213,6 +214,8 @@ func GeneratorParams_TypeFromPb(pb factorypb.GeneratorParams_Type) GeneratorPara return &GeneratorParams_PbftModule{PbftModule: types4.PBFTModuleFromPb(pb.PbftModule)} case *factorypb.GeneratorParams_PpvModule: return &GeneratorParams_PpvModule{PpvModule: types5.PPrepValidatorChkpFromPb(pb.PpvModule)} + case *factorypb.GeneratorParams_AccModule: + return &GeneratorParams_AccModule{AccModule: types6.InstanceParamsFromPb(pb.AccModule)} } return nil } @@ -337,6 +340,30 @@ func (*GeneratorParams_PpvModule) MirReflect() mirreflect.Type { return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*factorypb.GeneratorParams_PpvModule]()} } +type GeneratorParams_AccModule struct { + AccModule *types6.InstanceParams +} + +func (*GeneratorParams_AccModule) isGeneratorParams_Type() {} + +func (w *GeneratorParams_AccModule) Unwrap() *types6.InstanceParams { + return w.AccModule +} + +func (w *GeneratorParams_AccModule) Pb() factorypb.GeneratorParams_Type { + if w == nil { + return nil + } + if w.AccModule == nil { + return &factorypb.GeneratorParams_AccModule{} + } + return &factorypb.GeneratorParams_AccModule{AccModule: (w.AccModule).Pb()} +} + +func (*GeneratorParams_AccModule) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*factorypb.GeneratorParams_AccModule]()} +} + func GeneratorParamsFromPb(pb *factorypb.GeneratorParams) *GeneratorParams { if pb == nil { return nil diff --git a/pkg/pb/hasherpb/hasherpb.pb.go b/pkg/pb/hasherpb/hasherpb.pb.go index cdc0413ee..6e0da4f02 100644 --- a/pkg/pb/hasherpb/hasherpb.pb.go +++ b/pkg/pb/hasherpb/hasherpb.pb.go @@ -1,19 +1,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: hasherpb/hasherpb.proto package hasherpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/isspb/isspb.pb.go b/pkg/pb/isspb/isspb.pb.go index 825142a0a..c2b3ee31b 100644 --- a/pkg/pb/isspb/isspb.pb.go +++ b/pkg/pb/isspb/isspb.pb.go @@ -5,22 +5,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: isspb/isspb.proto package isspb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + availabilitypb "github.com/filecoin-project/mir/pkg/pb/availabilitypb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" _ "github.com/filecoin-project/mir/pkg/pb/net" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/mempoolpb/mempoolpb.pb.go b/pkg/pb/mempoolpb/mempoolpb.pb.go index 2bfc92bc6..8ec8128fc 100644 --- a/pkg/pb/mempoolpb/mempoolpb.pb.go +++ b/pkg/pb/mempoolpb/mempoolpb.pb.go @@ -1,20 +1,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: mempoolpb/mempoolpb.proto package mempoolpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/messagepb/messagepb.pb.go b/pkg/pb/messagepb/messagepb.pb.go index f642796cf..30a6a1bc8 100644 --- a/pkg/pb/messagepb/messagepb.pb.go +++ b/pkg/pb/messagepb/messagepb.pb.go @@ -5,13 +5,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: messagepb/messagepb.proto package messagepb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + accountabilitypb "github.com/filecoin-project/mir/pkg/pb/accountabilitypb" mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" bcbpb "github.com/filecoin-project/mir/pkg/pb/bcbpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" @@ -20,10 +27,6 @@ import ( _ "github.com/filecoin-project/mir/pkg/pb/net" ordererpb "github.com/filecoin-project/mir/pkg/pb/ordererpb" pingpongpb "github.com/filecoin-project/mir/pkg/pb/pingpongpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -46,6 +49,7 @@ type Message struct { // *Message_Pingpong // *Message_Checkpoint // *Message_Orderer + // *Message_Accountability Type isMessage_Type `protobuf_oneof:"type"` } @@ -137,6 +141,13 @@ func (x *Message) GetOrderer() *ordererpb.Message { return nil } +func (x *Message) GetAccountability() *accountabilitypb.Message { + if x, ok := x.GetType().(*Message_Accountability); ok { + return x.Accountability + } + return nil +} + type isMessage_Type interface { isMessage_Type() } @@ -165,6 +176,10 @@ type Message_Orderer struct { Orderer *ordererpb.Message `protobuf:"bytes,7,opt,name=orderer,proto3,oneof"` } +type Message_Accountability struct { + Accountability *accountabilitypb.Message `protobuf:"bytes,8,opt,name=accountability,proto3,oneof"` +} + func (*Message_Iss) isMessage_Type() {} func (*Message_Bcb) isMessage_Type() {} @@ -177,6 +192,8 @@ func (*Message_Checkpoint) isMessage_Type() {} func (*Message_Orderer) isMessage_Type() {} +func (*Message_Accountability) isMessage_Type() {} + var File_messagepb_messagepb_proto protoreflect.FileDescriptor var file_messagepb_messagepb_proto_rawDesc = []byte{ @@ -192,41 +209,48 @@ var file_messagepb_messagepb_proto_rawDesc = []byte{ 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, - 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, - 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x03, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x57, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0x82, 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x0a, 0x64, 0x65, - 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x03, 0x69, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x69, 0x73, 0x73, 0x70, 0x62, 0x2e, 0x49, 0x53, - 0x53, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x69, 0x73, 0x73, 0x12, - 0x22, 0x0a, 0x03, 0x62, 0x63, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, - 0x63, 0x62, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, - 0x62, 0x63, 0x62, 0x12, 0x4e, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x5f, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, - 0x2e, 0x6d, 0x73, 0x63, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, - 0x52, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, - 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x70, 0x69, - 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x37, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, - 0x2e, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3a, - 0x04, 0xc0, 0xe4, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0xc8, - 0xe4, 0x1d, 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x6d, 0x69, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf2, 0x03, 0x0a, + 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x57, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, + 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0x82, + 0xa6, 0x1d, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x69, + 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x6d, + 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x49, 0x44, 0x52, 0x0a, 0x64, 0x65, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x12, 0x25, 0x0a, 0x03, 0x69, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x69, 0x73, 0x73, 0x70, 0x62, 0x2e, 0x49, 0x53, 0x53, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x48, 0x00, 0x52, 0x03, 0x69, 0x73, 0x73, 0x12, 0x22, 0x0a, 0x03, 0x62, 0x63, 0x62, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x63, 0x62, 0x70, 0x62, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x62, 0x63, 0x62, 0x12, 0x4e, 0x0a, 0x12, + 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x76, 0x61, 0x69, 0x6c, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x70, 0x62, 0x2e, 0x6d, 0x73, 0x63, 0x70, 0x62, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, + 0x73, 0x69, 0x67, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x08, + 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x70, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x6e, 0x67, 0x12, + 0x37, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, + 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x3a, 0x04, 0xc0, + 0xe4, 0x1d, 0x01, 0x42, 0x0c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x04, 0xc8, 0xe4, 0x1d, + 0x01, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x66, 0x69, 0x6c, 0x65, 0x63, 0x6f, 0x69, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x2f, 0x6d, 0x69, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -243,13 +267,14 @@ func file_messagepb_messagepb_proto_rawDescGZIP() []byte { var file_messagepb_messagepb_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_messagepb_messagepb_proto_goTypes = []interface{}{ - (*Message)(nil), // 0: messagepb.Message - (*isspb.ISSMessage)(nil), // 1: isspb.ISSMessage - (*bcbpb.Message)(nil), // 2: bcbpb.Message - (*mscpb.Message)(nil), // 3: availabilitypb.mscpb.Message - (*pingpongpb.Message)(nil), // 4: pingpongpb.Message - (*checkpointpb.Message)(nil), // 5: checkpointpb.Message - (*ordererpb.Message)(nil), // 6: ordererpb.Message + (*Message)(nil), // 0: messagepb.Message + (*isspb.ISSMessage)(nil), // 1: isspb.ISSMessage + (*bcbpb.Message)(nil), // 2: bcbpb.Message + (*mscpb.Message)(nil), // 3: availabilitypb.mscpb.Message + (*pingpongpb.Message)(nil), // 4: pingpongpb.Message + (*checkpointpb.Message)(nil), // 5: checkpointpb.Message + (*ordererpb.Message)(nil), // 6: ordererpb.Message + (*accountabilitypb.Message)(nil), // 7: accountabilitypb.Message } var file_messagepb_messagepb_proto_depIdxs = []int32{ 1, // 0: messagepb.Message.iss:type_name -> isspb.ISSMessage @@ -258,11 +283,12 @@ var file_messagepb_messagepb_proto_depIdxs = []int32{ 4, // 3: messagepb.Message.pingpong:type_name -> pingpongpb.Message 5, // 4: messagepb.Message.checkpoint:type_name -> checkpointpb.Message 6, // 5: messagepb.Message.orderer:type_name -> ordererpb.Message - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 7, // 6: messagepb.Message.accountability:type_name -> accountabilitypb.Message + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_messagepb_messagepb_proto_init() } @@ -291,6 +317,7 @@ func file_messagepb_messagepb_proto_init() { (*Message_Pingpong)(nil), (*Message_Checkpoint)(nil), (*Message_Orderer)(nil), + (*Message_Accountability)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/pkg/pb/messagepb/messagepb.pb.mir.go b/pkg/pb/messagepb/messagepb.pb.mir.go index 4a44aaad3..76761eb70 100644 --- a/pkg/pb/messagepb/messagepb.pb.mir.go +++ b/pkg/pb/messagepb/messagepb.pb.mir.go @@ -14,5 +14,6 @@ func (*Message) ReflectTypeOptions() []reflect.Type { reflect.TypeOf((*Message_Pingpong)(nil)), reflect.TypeOf((*Message_Checkpoint)(nil)), reflect.TypeOf((*Message_Orderer)(nil)), + reflect.TypeOf((*Message_Accountability)(nil)), } } diff --git a/pkg/pb/messagepb/oneof_interfaces.mir.go b/pkg/pb/messagepb/oneof_interfaces.mir.go index 9cd5cdcd6..28903368e 100644 --- a/pkg/pb/messagepb/oneof_interfaces.mir.go +++ b/pkg/pb/messagepb/oneof_interfaces.mir.go @@ -3,6 +3,7 @@ package messagepb import ( + accountabilitypb "github.com/filecoin-project/mir/pkg/pb/accountabilitypb" mscpb "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb" bcbpb "github.com/filecoin-project/mir/pkg/pb/bcbpb" checkpointpb "github.com/filecoin-project/mir/pkg/pb/checkpointpb" @@ -41,3 +42,7 @@ func (w *Message_Checkpoint) Unwrap() *checkpointpb.Message { func (w *Message_Orderer) Unwrap() *ordererpb.Message { return w.Orderer } + +func (w *Message_Accountability) Unwrap() *accountabilitypb.Message { + return w.Accountability +} diff --git a/pkg/pb/messagepb/types/types.mir.go b/pkg/pb/messagepb/types/types.mir.go index 3d55bc14b..28a7f2130 100644 --- a/pkg/pb/messagepb/types/types.mir.go +++ b/pkg/pb/messagepb/types/types.mir.go @@ -4,6 +4,7 @@ package messagepbtypes import ( mirreflect "github.com/filecoin-project/mir/codegen/mirreflect" + types7 "github.com/filecoin-project/mir/pkg/pb/accountabilitypb/types" types3 "github.com/filecoin-project/mir/pkg/pb/availabilitypb/mscpb/types" types2 "github.com/filecoin-project/mir/pkg/pb/bcbpb/types" types5 "github.com/filecoin-project/mir/pkg/pb/checkpointpb/types" @@ -48,6 +49,8 @@ func Message_TypeFromPb(pb messagepb.Message_Type) Message_Type { return &Message_Checkpoint{Checkpoint: types5.MessageFromPb(pb.Checkpoint)} case *messagepb.Message_Orderer: return &Message_Orderer{Orderer: types6.MessageFromPb(pb.Orderer)} + case *messagepb.Message_Accountability: + return &Message_Accountability{Accountability: types7.MessageFromPb(pb.Accountability)} } return nil } @@ -196,6 +199,30 @@ func (*Message_Orderer) MirReflect() mirreflect.Type { return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*messagepb.Message_Orderer]()} } +type Message_Accountability struct { + Accountability *types7.Message +} + +func (*Message_Accountability) isMessage_Type() {} + +func (w *Message_Accountability) Unwrap() *types7.Message { + return w.Accountability +} + +func (w *Message_Accountability) Pb() messagepb.Message_Type { + if w == nil { + return nil + } + if w.Accountability == nil { + return &messagepb.Message_Accountability{} + } + return &messagepb.Message_Accountability{Accountability: (w.Accountability).Pb()} +} + +func (*Message_Accountability) MirReflect() mirreflect.Type { + return mirreflect.TypeImpl{PbType_: reflectutil.TypeOf[*messagepb.Message_Accountability]()} +} + func MessageFromPb(pb *messagepb.Message) *Message { if pb == nil { return nil diff --git a/pkg/pb/mir/codegen_extensions.pb.go b/pkg/pb/mir/codegen_extensions.pb.go index 7e20985ec..a2011431f 100644 --- a/pkg/pb/mir/codegen_extensions.pb.go +++ b/pkg/pb/mir/codegen_extensions.pb.go @@ -1,16 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: mir/codegen_extensions.proto package mir import ( + reflect "reflect" + + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" ) const ( @@ -22,7 +23,7 @@ const ( var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60000, Name: "mir.struct", @@ -30,7 +31,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60001, Name: "mir.event_root", @@ -38,7 +39,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60002, Name: "mir.event_class", @@ -46,7 +47,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 60003, Name: "mir.event", @@ -54,7 +55,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtendedType: (*descriptor.OneofOptions)(nil), ExtensionType: (*bool)(nil), Field: 60000, Name: "mir.event_type", @@ -62,7 +63,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 60000, Name: "mir.type", @@ -70,7 +71,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 60002, Name: "mir.omit_in_event_constructors", @@ -78,7 +79,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 60003, Name: "mir.origin_request", @@ -86,7 +87,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 60004, Name: "mir.origin_response", @@ -94,7 +95,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 60005, Name: "mir.key_type", @@ -102,7 +103,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "mir/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 60006, Name: "mir.value_type", @@ -111,7 +112,7 @@ var file_mir_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptorpb.MessageOptions. +// Extension fields to descriptor.MessageOptions. var ( // optional bool struct = 60000; E_Struct = &file_mir_codegen_extensions_proto_extTypes[0] @@ -123,13 +124,13 @@ var ( E_Event = &file_mir_codegen_extensions_proto_extTypes[3] ) -// Extension fields to descriptorpb.OneofOptions. +// Extension fields to descriptor.OneofOptions. var ( // optional bool event_type = 60000; E_EventType = &file_mir_codegen_extensions_proto_extTypes[4] ) -// Extension fields to descriptorpb.FieldOptions. +// Extension fields to descriptor.FieldOptions. var ( // optional string type = 60000; E_Type = &file_mir_codegen_extensions_proto_extTypes[5] @@ -205,9 +206,9 @@ var file_mir_codegen_extensions_proto_rawDesc = []byte{ } var file_mir_codegen_extensions_proto_goTypes = []interface{}{ - (*descriptorpb.MessageOptions)(nil), // 0: google.protobuf.MessageOptions - (*descriptorpb.OneofOptions)(nil), // 1: google.protobuf.OneofOptions - (*descriptorpb.FieldOptions)(nil), // 2: google.protobuf.FieldOptions + (*descriptor.MessageOptions)(nil), // 0: google.protobuf.MessageOptions + (*descriptor.OneofOptions)(nil), // 1: google.protobuf.OneofOptions + (*descriptor.FieldOptions)(nil), // 2: google.protobuf.FieldOptions } var file_mir_codegen_extensions_proto_depIdxs = []int32{ 0, // 0: mir.struct:extendee -> google.protobuf.MessageOptions diff --git a/pkg/pb/net/codegen_extensions.pb.go b/pkg/pb/net/codegen_extensions.pb.go index 8175c8679..7e3f34419 100644 --- a/pkg/pb/net/codegen_extensions.pb.go +++ b/pkg/pb/net/codegen_extensions.pb.go @@ -1,16 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: net/codegen_extensions.proto package net import ( + reflect "reflect" + + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" ) const ( @@ -22,7 +23,7 @@ const ( var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 61000, Name: "net.message_root", @@ -30,7 +31,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "net/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 61001, Name: "net.message_class", @@ -38,7 +39,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "net/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 61002, Name: "net.message", @@ -46,7 +47,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "net/codegen_extensions.proto", }, { - ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtendedType: (*descriptor.OneofOptions)(nil), ExtensionType: (*bool)(nil), Field: 61001, Name: "net.message_type", @@ -55,7 +56,7 @@ var file_net_codegen_extensions_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptorpb.MessageOptions. +// Extension fields to descriptor.MessageOptions. var ( // optional bool message_root = 61000; E_MessageRoot = &file_net_codegen_extensions_proto_extTypes[0] @@ -65,7 +66,7 @@ var ( E_Message = &file_net_codegen_extensions_proto_extTypes[2] ) -// Extension fields to descriptorpb.OneofOptions. +// Extension fields to descriptor.OneofOptions. var ( // optional bool message_type = 61001; E_MessageType = &file_net_codegen_extensions_proto_extTypes[3] @@ -102,8 +103,8 @@ var file_net_codegen_extensions_proto_rawDesc = []byte{ } var file_net_codegen_extensions_proto_goTypes = []interface{}{ - (*descriptorpb.MessageOptions)(nil), // 0: google.protobuf.MessageOptions - (*descriptorpb.OneofOptions)(nil), // 1: google.protobuf.OneofOptions + (*descriptor.MessageOptions)(nil), // 0: google.protobuf.MessageOptions + (*descriptor.OneofOptions)(nil), // 1: google.protobuf.OneofOptions } var file_net_codegen_extensions_proto_depIdxs = []int32{ 0, // 0: net.message_root:extendee -> google.protobuf.MessageOptions diff --git a/pkg/pb/ordererpb/ordererpb.pb.go b/pkg/pb/ordererpb/ordererpb.pb.go index 6be8f8e28..b8c92535e 100644 --- a/pkg/pb/ordererpb/ordererpb.pb.go +++ b/pkg/pb/ordererpb/ordererpb.pb.go @@ -1,20 +1,22 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: ordererpb/ordererpb.proto package ordererpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "github.com/filecoin-project/mir/pkg/pb/mir" _ "github.com/filecoin-project/mir/pkg/pb/net" pbftpb "github.com/filecoin-project/mir/pkg/pb/pbftpb" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go b/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go index 40f6d4855..be426e6f4 100644 --- a/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go +++ b/pkg/pb/ordererpb/pprepvalidatorpb/pprepvalidatorpb.pb.go @@ -1,21 +1,23 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: ordererpb/pprepvalidatorpb/pprepvalidatorpb.proto package pprepvalidatorpb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" pbftpb "github.com/filecoin-project/mir/pkg/pb/pbftpb" trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/pbftpb/pbftpb.pb.go b/pkg/pb/pbftpb/pbftpb.pb.go index 62b472a49..f9f2d3d88 100644 --- a/pkg/pb/pbftpb/pbftpb.pb.go +++ b/pkg/pb/pbftpb/pbftpb.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: pbftpb/pbftpb.proto package pbftpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - _ "github.com/filecoin-project/mir/pkg/pb/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" + _ "github.com/filecoin-project/mir/pkg/pb/net" ) const ( diff --git a/pkg/pb/pingpongpb/pingpongpb.pb.go b/pkg/pb/pingpongpb/pingpongpb.pb.go index 2f88aec7c..41ed4b6a0 100644 --- a/pkg/pb/pingpongpb/pingpongpb.pb.go +++ b/pkg/pb/pingpongpb/pingpongpb.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: pingpongpb/pingpongpb.proto package pingpongpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - _ "github.com/filecoin-project/mir/pkg/pb/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" + _ "github.com/filecoin-project/mir/pkg/pb/net" ) const ( diff --git a/pkg/pb/recordingpb/recordingpb.pb.go b/pkg/pb/recordingpb/recordingpb.pb.go index 2585b98fa..fad3b18d4 100644 --- a/pkg/pb/recordingpb/recordingpb.pb.go +++ b/pkg/pb/recordingpb/recordingpb.pb.go @@ -5,18 +5,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: recordingpb/recordingpb.proto package recordingpb import ( - eventpb "github.com/filecoin-project/mir/pkg/pb/eventpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + eventpb "github.com/filecoin-project/mir/pkg/pb/eventpb" ) const ( diff --git a/pkg/pb/testerpb/testerpb.pb.go b/pkg/pb/testerpb/testerpb.pb.go index 7dedd89c7..607b43395 100644 --- a/pkg/pb/testerpb/testerpb.pb.go +++ b/pkg/pb/testerpb/testerpb.pb.go @@ -1,17 +1,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: testerpb/testerpb.proto package testerpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" ) const ( diff --git a/pkg/pb/threshcryptopb/threshcryptopb.pb.go b/pkg/pb/threshcryptopb/threshcryptopb.pb.go index 739438330..74a02ab4f 100644 --- a/pkg/pb/threshcryptopb/threshcryptopb.pb.go +++ b/pkg/pb/threshcryptopb/threshcryptopb.pb.go @@ -1,19 +1,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: threshcryptopb/threshcryptopb.proto package threshcryptopb import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + contextstorepb "github.com/filecoin-project/mir/pkg/pb/contextstorepb" dslpb "github.com/filecoin-project/mir/pkg/pb/dslpb" _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/pb/transportpb/transportpb.pb.go b/pkg/pb/transportpb/transportpb.pb.go index ef42d1f2b..ff6fd6516 100644 --- a/pkg/pb/transportpb/transportpb.pb.go +++ b/pkg/pb/transportpb/transportpb.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: transportpb/transportpb.proto package transportpb import ( - messagepb "github.com/filecoin-project/mir/pkg/pb/messagepb" - _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + messagepb "github.com/filecoin-project/mir/pkg/pb/messagepb" + _ "github.com/filecoin-project/mir/pkg/pb/mir" ) const ( diff --git a/pkg/pb/trantorpb/trantorpb.pb.go b/pkg/pb/trantorpb/trantorpb.pb.go index ad414366b..7707a87a7 100644 --- a/pkg/pb/trantorpb/trantorpb.pb.go +++ b/pkg/pb/trantorpb/trantorpb.pb.go @@ -1,17 +1,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: trantorpb/trantorpb.proto package trantorpb import ( - _ "github.com/filecoin-project/mir/pkg/pb/mir" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + _ "github.com/filecoin-project/mir/pkg/pb/mir" ) const ( diff --git a/pkg/transactionreceiver/transactionreceiver.pb.go b/pkg/transactionreceiver/transactionreceiver.pb.go index c67b5b369..7e0499e7e 100644 --- a/pkg/transactionreceiver/transactionreceiver.pb.go +++ b/pkg/transactionreceiver/transactionreceiver.pb.go @@ -5,18 +5,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: transactionreceiver/transactionreceiver.proto package transactionreceiver import ( - trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" ) const ( diff --git a/pkg/transactionreceiver/transactionreceiver_grpc.pb.go b/pkg/transactionreceiver/transactionreceiver_grpc.pb.go index c088751b1..c319664f5 100644 --- a/pkg/transactionreceiver/transactionreceiver_grpc.pb.go +++ b/pkg/transactionreceiver/transactionreceiver_grpc.pb.go @@ -1,13 +1,19 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: transactionreceiver/transactionreceiver.proto package transactionreceiver import ( context "context" - trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + + trantorpb "github.com/filecoin-project/mir/pkg/pb/trantorpb" ) // This is a compile-time assertion to ensure that this generated file diff --git a/pkg/util/maputil/maputil.go b/pkg/util/maputil/maputil.go index 74568c98f..d6541ee6c 100644 --- a/pkg/util/maputil/maputil.go +++ b/pkg/util/maputil/maputil.go @@ -116,6 +116,16 @@ func Transform[Ki comparable, Vi any, Ko comparable, Vo any](mi map[Ki]Vi, f fun return mo } +func Filter[K comparable, V any](m map[K]V, pred func(K, V) bool) map[K]V { + result := make(map[K]V) + for k, v := range m { + if pred(k, v) { + result[k] = v + } + } + return result +} + // FromSlices constructs and returns a map from two separate slices of keys and corresponding values. // FromSlices panics if the number of keys differs from the number of values. func FromSlices[K comparable, V any](keys []K, vals []V) map[K]V { diff --git a/protos/accountabilitypb/accountabilitypb.proto b/protos/accountabilitypb/accountabilitypb.proto new file mode 100644 index 000000000..653ac51aa --- /dev/null +++ b/protos/accountabilitypb/accountabilitypb.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + +package accountabilitypb; + +option go_package = "github.com/filecoin-project/mir/pkg/pb/accountabilitypb"; + +import "trantorpb/trantorpb.proto"; + +import "net/codegen_extensions.proto"; +import "mir/codegen_extensions.proto"; + +message PoM { + option (mir.struct) = true; + + string node_id = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/types.NodeID"]; + SignedPredecision conflicting_msg_1 = 2; + SignedPredecision conflicting_msg_2 = 3; + +} + +message LightCertificate { + option (net.message) = true; + bytes data = 1; +} + +message PoMs { + option (net.message) = true; + + repeated PoM poms = 1; +} + +message Message { + option (net.message_class) = true; + + oneof type { + option (net.message_type) = true; + + SignedPredecision signed_predecision = 1; + FullCertificate certificate = 2; + PoMs poms = 3; + LightCertificate light_certificate = 4; + } +} + +message SignedPredecision { + option (net.message) = true; + option (mir.struct) = true; + + bytes predecision = 1; + bytes signature = 2; +} + +message FullCertificate { + option (net.message) = true; + + bytes decision = 1; + map signatures = 2 [(mir.key_type) = "github.com/filecoin-project/mir/pkg/types.NodeID"]; +} + +message InstanceParams { + option (mir.struct) = true; + + trantorpb.Membership membership = 1; + uint64 retention_index = 2 [(mir.type) = "github.com/filecoin-project/mir/pkg/trantor/types.RetentionIndex"]; +} \ No newline at end of file diff --git a/protos/availabilitypb/batchdbpb/batchdbpb.proto b/protos/availabilitypb/batchdbpb/batchdbpb.proto index 4157f0f8d..97fc85fe6 100644 --- a/protos/availabilitypb/batchdbpb/batchdbpb.proto +++ b/protos/availabilitypb/batchdbpb/batchdbpb.proto @@ -75,13 +75,13 @@ message GarbageCollect { message LookupBatchOrigin { option (mir.event_class) = true; - string module = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/types.ModuleID"]; - oneof Type { - option (mir.event_type) = true; + string module = 1 [(mir.type) = "github.com/filecoin-project/mir/pkg/types.ModuleID"]; + oneof Type { + option (mir.event_type) = true; - contextstorepb.Origin context_store = 2; - dslpb.Origin dsl = 3; - } + contextstorepb.Origin context_store = 2; + dslpb.Origin dsl = 3; + } } message StoreBatchOrigin { diff --git a/protos/factorypb/factorypb.proto b/protos/factorypb/factorypb.proto index a3a080a8b..20b959ced 100644 --- a/protos/factorypb/factorypb.proto +++ b/protos/factorypb/factorypb.proto @@ -8,7 +8,7 @@ import "availabilitypb/mscpb/mscpb.proto"; import "checkpointpb/checkpointpb.proto"; import "ordererpb/ordererpb.proto"; import "ordererpb/pprepvalidatorpb/pprepvalidatorpb.proto"; - +import "accountabilitypb/accountabilitypb.proto"; import "mir/codegen_extensions.proto"; @@ -52,6 +52,7 @@ message GeneratorParams { EchoModuleParams echo_test_module = 3; ordererpb.PBFTModule pbft_module = 4; pprepvalidatorpb.PPrepValidatorChkp ppv_module = 5; + accountabilitypb.InstanceParams acc_module = 6; } } diff --git a/protos/generate.go b/protos/generate.go index b16ff152b..d330d8b1f 100644 --- a/protos/generate.go +++ b/protos/generate.go @@ -43,6 +43,7 @@ package protos //go:generate protoc-events cryptopb/cryptopb.proto //go:generate protoc-events apppb/apppb.proto //go:generate protoc-events transportpb/transportpb.proto +//go:generate protoc-events accountabilitypb/accountabilitypb.proto //go:generate protoc-events testerpb/testerpb.proto // Build the custom code generators. @@ -73,6 +74,7 @@ package protos //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/cryptopb" //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/apppb" //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/transportpb" +//go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/accountabilitypb" //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/testerpb" //go:generate std-gen "github.com/filecoin-project/mir/pkg/pb/pingpongpb" diff --git a/protos/messagepb/messagepb.proto b/protos/messagepb/messagepb.proto index b440113e6..b7efb5c1d 100644 --- a/protos/messagepb/messagepb.proto +++ b/protos/messagepb/messagepb.proto @@ -16,6 +16,7 @@ import "availabilitypb/mscpb/mscpb.proto"; import "pingpongpb/pingpongpb.proto"; import "checkpointpb/checkpointpb.proto"; import "ordererpb/ordererpb.proto"; +import "accountabilitypb/accountabilitypb.proto"; import "mir/codegen_extensions.proto"; import "net/codegen_extensions.proto"; @@ -28,11 +29,13 @@ message Message { oneof type { option (net.message_type) = true; - isspb.ISSMessage iss = 2; - bcbpb.Message bcb = 3; - availabilitypb.mscpb.Message multisig_collector = 4; - pingpongpb.Message pingpong = 5; - checkpointpb.Message checkpoint = 6; - ordererpb.Message orderer = 7; + isspb.ISSMessage iss = 2; + bcbpb.Message bcb = 3; + availabilitypb.mscpb.Message multisig_collector = 4; + pingpongpb.Message pingpong = 5; + checkpointpb.Message checkpoint = 6; + ordererpb.Message orderer = 7; + accountabilitypb.Message accountability = 8; + } }