mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 18:37:26 +08:00
faster, simpler sync with some debug extras
This commit is contained in:
parent
69519ad0cb
commit
bc827eda3f
@ -171,15 +171,27 @@ func (hg *HypergraphCRDT) snapshotSet(
|
||||
hg.setsMu.RUnlock()
|
||||
|
||||
if set == nil {
|
||||
// Try to load root from snapshot store since set doesn't exist in memory
|
||||
var root tries.LazyVectorCommitmentNode
|
||||
if targetStore != nil {
|
||||
root, _ = targetStore.GetNodeByPath(
|
||||
string(atomType),
|
||||
string(phaseType),
|
||||
shardKey,
|
||||
[]int{}, // empty path = root
|
||||
)
|
||||
}
|
||||
set = NewIdSet(
|
||||
atomType,
|
||||
phaseType,
|
||||
shardKey,
|
||||
hg.store,
|
||||
targetStore, // Use target store directly since set is new
|
||||
hg.prover,
|
||||
nil,
|
||||
root,
|
||||
hg.getCoveredPrefix(),
|
||||
)
|
||||
// Return directly - no need to clone since we already used targetStore
|
||||
return set
|
||||
}
|
||||
|
||||
return hg.cloneSetWithStore(set, targetStore)
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"slices"
|
||||
"strings"
|
||||
@ -73,7 +74,12 @@ func (hg *HypergraphCRDT) PerformSync(
|
||||
case *protobufs.HypergraphSyncQuery_GetBranch:
|
||||
// Initialize session on first request
|
||||
if session == nil {
|
||||
session, err = hg.initSyncSession(r.GetBranch.ShardKey, r.GetBranch.PhaseSet, logger)
|
||||
session, err = hg.initSyncSession(
|
||||
r.GetBranch.ShardKey,
|
||||
r.GetBranch.PhaseSet,
|
||||
r.GetBranch.ExpectedRoot,
|
||||
logger,
|
||||
)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "init sync session")
|
||||
}
|
||||
@ -82,7 +88,12 @@ func (hg *HypergraphCRDT) PerformSync(
|
||||
case *protobufs.HypergraphSyncQuery_GetLeaves:
|
||||
// Initialize session on first request
|
||||
if session == nil {
|
||||
session, err = hg.initSyncSession(r.GetLeaves.ShardKey, r.GetLeaves.PhaseSet, logger)
|
||||
session, err = hg.initSyncSession(
|
||||
r.GetLeaves.ShardKey,
|
||||
r.GetLeaves.PhaseSet,
|
||||
r.GetLeaves.ExpectedRoot,
|
||||
logger,
|
||||
)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "init sync session")
|
||||
}
|
||||
@ -121,6 +132,7 @@ func (hg *HypergraphCRDT) PerformSync(
|
||||
func (hg *HypergraphCRDT) initSyncSession(
|
||||
shardKeyBytes []byte,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
expectedRoot []byte,
|
||||
logger *zap.Logger,
|
||||
) (*syncSession, error) {
|
||||
if len(shardKeyBytes) != 35 {
|
||||
@ -132,8 +144,9 @@ func (hg *HypergraphCRDT) initSyncSession(
|
||||
L2: [32]byte(shardKeyBytes[3:]),
|
||||
}
|
||||
|
||||
// Acquire a snapshot for consistent reads throughout the session
|
||||
snapshot := hg.snapshotMgr.acquire(shardKey, nil)
|
||||
// Acquire a snapshot for consistent reads throughout the session.
|
||||
// If expectedRoot is provided, we try to find a snapshot matching that root.
|
||||
snapshot := hg.snapshotMgr.acquire(shardKey, expectedRoot)
|
||||
if snapshot == nil {
|
||||
return nil, errors.New("failed to acquire snapshot")
|
||||
}
|
||||
@ -145,10 +158,14 @@ func (hg *HypergraphCRDT) initSyncSession(
|
||||
return nil, errors.New("unsupported phase set")
|
||||
}
|
||||
|
||||
tree := idSet.GetTree()
|
||||
logger.Debug(
|
||||
"sync session initialized",
|
||||
zap.String("shard", hex.EncodeToString(shardKeyBytes)),
|
||||
zap.Int("phaseSet", int(phaseSet)),
|
||||
zap.Bool("tree_nil", tree == nil),
|
||||
zap.Bool("root_nil", tree != nil && tree.Root == nil),
|
||||
zap.String("snapshot_root", hex.EncodeToString(snapshot.Root())),
|
||||
)
|
||||
|
||||
return &syncSession{
|
||||
@ -169,6 +186,11 @@ func (hg *HypergraphCRDT) handleGetBranch(
|
||||
tree := session.idSet.GetTree()
|
||||
if tree == nil || tree.Root == nil {
|
||||
// Empty tree - return empty response
|
||||
logger.Debug("handleGetBranch: empty tree",
|
||||
zap.Bool("tree_nil", tree == nil),
|
||||
zap.Bool("root_nil", tree != nil && tree.Root == nil),
|
||||
zap.String("path", hex.EncodeToString(packPath(req.Path))),
|
||||
)
|
||||
return &protobufs.HypergraphSyncResponse{
|
||||
Response: &protobufs.HypergraphSyncResponse_Branch{
|
||||
Branch: &protobufs.HypergraphSyncBranchResponse{
|
||||
@ -312,6 +334,25 @@ func (hg *HypergraphCRDT) handleGetLeaves(
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Debug: log node details to identify snapshot consistency issues
|
||||
var nodeCommitment []byte
|
||||
var nodeStore string
|
||||
switch n := node.(type) {
|
||||
case *tries.LazyVectorCommitmentBranchNode:
|
||||
nodeCommitment = n.Commitment
|
||||
nodeStore = fmt.Sprintf("%p", n.Store)
|
||||
case *tries.LazyVectorCommitmentLeafNode:
|
||||
nodeCommitment = n.Commitment
|
||||
nodeStore = fmt.Sprintf("%p", n.Store)
|
||||
}
|
||||
logger.Debug("handleGetLeaves node info",
|
||||
zap.String("path", hex.EncodeToString(packPath(req.Path))),
|
||||
zap.String("nodeCommitment", hex.EncodeToString(nodeCommitment)),
|
||||
zap.String("nodeStore", nodeStore),
|
||||
zap.String("sessionStore", fmt.Sprintf("%p", session.store)),
|
||||
zap.Int("contTokenLen", len(req.ContinuationToken)),
|
||||
)
|
||||
|
||||
// Get all leaves under this node
|
||||
allLeaves := tries.GetAllLeaves(
|
||||
tree.SetType,
|
||||
@ -372,6 +413,17 @@ func (hg *HypergraphCRDT) handleGetLeaves(
|
||||
_ = i // suppress unused warning
|
||||
}
|
||||
|
||||
// Debug: log leaf count details
|
||||
logger.Debug("handleGetLeaves returning",
|
||||
zap.String("path", hex.EncodeToString(packPath(req.Path))),
|
||||
zap.Int("allLeavesLen", len(allLeaves)),
|
||||
zap.Uint64("totalNonNil", totalNonNil),
|
||||
zap.Int("startIdx", startIdx),
|
||||
zap.Int("leavesReturned", len(leaves)),
|
||||
zap.String("treePtr", fmt.Sprintf("%p", tree)),
|
||||
zap.String("treeRootPtr", fmt.Sprintf("%p", tree.Root)),
|
||||
)
|
||||
|
||||
resp := &protobufs.HypergraphSyncLeavesResponse{
|
||||
Path: req.Path,
|
||||
Leaves: leaves,
|
||||
@ -412,17 +464,15 @@ func parseContToken(token []byte) (int, error) {
|
||||
if len(token) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
var idx int
|
||||
_, err := hex.Decode(make([]byte, len(token)/2), token)
|
||||
// Token is hex-encoded 4 bytes (big-endian int32)
|
||||
decoded, err := hex.DecodeString(string(token))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
// Simple: just parse as decimal string
|
||||
for _, b := range token {
|
||||
if b >= '0' && b <= '9' {
|
||||
idx = idx*10 + int(b-'0')
|
||||
}
|
||||
if len(decoded) != 4 {
|
||||
return 0, errors.New("invalid continuation token length")
|
||||
}
|
||||
idx := int(decoded[0])<<24 | int(decoded[1])<<16 | int(decoded[2])<<8 | int(decoded[3])
|
||||
return idx, nil
|
||||
}
|
||||
|
||||
@ -432,12 +482,15 @@ func makeContToken(idx int) []byte {
|
||||
|
||||
// SyncFrom performs a client-driven sync from the given server stream.
|
||||
// It navigates to the covered prefix (if any), then recursively syncs
|
||||
// differing subtrees.
|
||||
// differing subtrees. If expectedRoot is provided, the server will attempt
|
||||
// to sync from a snapshot matching that root commitment.
|
||||
// Returns the new root commitment after sync completes.
|
||||
func (hg *HypergraphCRDT) SyncFrom(
|
||||
stream protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
) error {
|
||||
expectedRoot []byte,
|
||||
) ([]byte, error) {
|
||||
hg.mu.Lock()
|
||||
defer hg.mu.Unlock()
|
||||
|
||||
@ -445,6 +498,9 @@ func (hg *HypergraphCRDT) SyncFrom(
|
||||
zap.String("method", "SyncFrom"),
|
||||
zap.String("shard", hex.EncodeToString(slices.Concat(shardKey.L1[:], shardKey.L2[:]))),
|
||||
)
|
||||
if len(expectedRoot) > 0 {
|
||||
logger = logger.With(zap.String("expectedRoot", hex.EncodeToString(expectedRoot)))
|
||||
}
|
||||
|
||||
syncStart := time.Now()
|
||||
defer func() {
|
||||
@ -453,30 +509,39 @@ func (hg *HypergraphCRDT) SyncFrom(
|
||||
|
||||
set := hg.getPhaseSet(shardKey, phaseSet)
|
||||
if set == nil {
|
||||
return errors.New("unsupported phase set")
|
||||
return nil, errors.New("unsupported phase set")
|
||||
}
|
||||
|
||||
shardKeyBytes := slices.Concat(shardKey.L1[:], shardKey.L2[:])
|
||||
coveredPrefix := hg.getCoveredPrefix()
|
||||
|
||||
// Step 1: Navigate to sync point
|
||||
syncPoint, err := hg.navigateToSyncPoint(stream, shardKeyBytes, phaseSet, coveredPrefix, logger)
|
||||
syncPoint, err := hg.navigateToSyncPoint(stream, shardKeyBytes, phaseSet, coveredPrefix, expectedRoot, logger)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "navigate to sync point")
|
||||
return nil, errors.Wrap(err, "navigate to sync point")
|
||||
}
|
||||
|
||||
if syncPoint == nil || len(syncPoint.Commitment) == 0 {
|
||||
logger.Info("server has no data at sync point")
|
||||
return nil
|
||||
// Return current root even if no data was synced
|
||||
root := set.GetTree().Commit(false)
|
||||
return root, nil
|
||||
}
|
||||
|
||||
// Step 2: Sync the subtree
|
||||
err = hg.syncSubtree(stream, shardKeyBytes, phaseSet, syncPoint, set, logger)
|
||||
err = hg.syncSubtree(stream, shardKeyBytes, phaseSet, expectedRoot, syncPoint, set, logger)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "sync subtree")
|
||||
return nil, errors.Wrap(err, "sync subtree")
|
||||
}
|
||||
|
||||
return nil
|
||||
// Step 3: Recompute commitment so future syncs see updated state
|
||||
root := set.GetTree().Commit(false)
|
||||
logger.Info(
|
||||
"hypergraph root commit after sync",
|
||||
zap.String("root", hex.EncodeToString(root)),
|
||||
)
|
||||
|
||||
return root, nil
|
||||
}
|
||||
|
||||
func (hg *HypergraphCRDT) navigateToSyncPoint(
|
||||
@ -484,6 +549,7 @@ func (hg *HypergraphCRDT) navigateToSyncPoint(
|
||||
shardKey []byte,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
coveredPrefix []int,
|
||||
expectedRoot []byte,
|
||||
logger *zap.Logger,
|
||||
) (*protobufs.HypergraphSyncBranchResponse, error) {
|
||||
path := []int32{}
|
||||
@ -493,9 +559,10 @@ func (hg *HypergraphCRDT) navigateToSyncPoint(
|
||||
err := stream.Send(&protobufs.HypergraphSyncQuery{
|
||||
Request: &protobufs.HypergraphSyncQuery_GetBranch{
|
||||
GetBranch: &protobufs.HypergraphSyncGetBranchRequest{
|
||||
ShardKey: shardKey,
|
||||
PhaseSet: phaseSet,
|
||||
Path: path,
|
||||
ShardKey: shardKey,
|
||||
PhaseSet: phaseSet,
|
||||
Path: path,
|
||||
ExpectedRoot: expectedRoot,
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -574,6 +641,7 @@ func (hg *HypergraphCRDT) syncSubtree(
|
||||
stream protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey []byte,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
expectedRoot []byte,
|
||||
serverBranch *protobufs.HypergraphSyncBranchResponse,
|
||||
localSet hypergraph.IdSet,
|
||||
logger *zap.Logger,
|
||||
@ -582,9 +650,10 @@ func (hg *HypergraphCRDT) syncSubtree(
|
||||
|
||||
// Get local node at same path
|
||||
var localCommitment []byte
|
||||
var localNode tries.LazyVectorCommitmentNode
|
||||
if tree != nil && tree.Root != nil {
|
||||
path := toIntSlice(serverBranch.FullPath)
|
||||
localNode := getNodeAtPath(
|
||||
localNode = getNodeAtPath(
|
||||
logger,
|
||||
tree.SetType,
|
||||
tree.PhaseType,
|
||||
@ -614,22 +683,24 @@ func (hg *HypergraphCRDT) syncSubtree(
|
||||
|
||||
// If server node is a leaf or has no children, fetch all leaves
|
||||
if serverBranch.IsLeaf || len(serverBranch.Children) == 0 {
|
||||
return hg.fetchAndIntegrateLeaves(stream, shardKey, phaseSet, serverBranch.FullPath, localSet, logger)
|
||||
return hg.fetchAndIntegrateLeaves(stream, shardKey, phaseSet, expectedRoot, serverBranch.FullPath, localSet, logger)
|
||||
}
|
||||
|
||||
// OPTIMIZATION: If we have NO local data at this path, skip the branch-by-branch
|
||||
// traversal and just fetch all leaves directly. This avoids N round trips for N
|
||||
// children when we know we need all of them anyway.
|
||||
if localNode == nil {
|
||||
logger.Debug("no local data at path, fetching all leaves directly",
|
||||
zap.String("path", hex.EncodeToString(packPath(serverBranch.FullPath))),
|
||||
zap.Int("serverChildren", len(serverBranch.Children)),
|
||||
)
|
||||
return hg.fetchAndIntegrateLeaves(stream, shardKey, phaseSet, expectedRoot, serverBranch.FullPath, localSet, logger)
|
||||
}
|
||||
|
||||
// Compare children and recurse
|
||||
localChildren := make(map[int32][]byte)
|
||||
if tree != nil && tree.Root != nil {
|
||||
path := toIntSlice(serverBranch.FullPath)
|
||||
localNode := getNodeAtPath(
|
||||
logger,
|
||||
tree.SetType,
|
||||
tree.PhaseType,
|
||||
tree.ShardKey,
|
||||
tree.Root,
|
||||
serverBranch.FullPath,
|
||||
0,
|
||||
)
|
||||
if branch, ok := localNode.(*tries.LazyVectorCommitmentBranchNode); ok {
|
||||
for i := 0; i < 64; i++ {
|
||||
child := branch.Children[i]
|
||||
@ -670,9 +741,10 @@ func (hg *HypergraphCRDT) syncSubtree(
|
||||
err := stream.Send(&protobufs.HypergraphSyncQuery{
|
||||
Request: &protobufs.HypergraphSyncQuery_GetBranch{
|
||||
GetBranch: &protobufs.HypergraphSyncGetBranchRequest{
|
||||
ShardKey: shardKey,
|
||||
PhaseSet: phaseSet,
|
||||
Path: childPath,
|
||||
ShardKey: shardKey,
|
||||
PhaseSet: phaseSet,
|
||||
Path: childPath,
|
||||
ExpectedRoot: expectedRoot,
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -699,7 +771,7 @@ func (hg *HypergraphCRDT) syncSubtree(
|
||||
}
|
||||
|
||||
// Recurse
|
||||
if err := hg.syncSubtree(stream, shardKey, phaseSet, childBranch, localSet, logger); err != nil {
|
||||
if err := hg.syncSubtree(stream, shardKey, phaseSet, expectedRoot, childBranch, localSet, logger); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -711,6 +783,7 @@ func (hg *HypergraphCRDT) fetchAndIntegrateLeaves(
|
||||
stream protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey []byte,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
expectedRoot []byte,
|
||||
path []int32,
|
||||
localSet hypergraph.IdSet,
|
||||
logger *zap.Logger,
|
||||
@ -731,6 +804,7 @@ func (hg *HypergraphCRDT) fetchAndIntegrateLeaves(
|
||||
Path: path,
|
||||
MaxLeaves: 1000,
|
||||
ContinuationToken: continuationToken,
|
||||
ExpectedRoot: expectedRoot,
|
||||
},
|
||||
},
|
||||
})
|
||||
@ -784,6 +858,7 @@ func (hg *HypergraphCRDT) fetchAndIntegrateLeaves(
|
||||
totalFetched += len(leavesResp.Leaves)
|
||||
|
||||
logger.Debug("fetched leaves batch",
|
||||
zap.String("path", hex.EncodeToString(packPath(path))),
|
||||
zap.Int("count", len(leavesResp.Leaves)),
|
||||
zap.Int("totalFetched", totalFetched),
|
||||
zap.Uint64("totalAvailable", leavesResp.TotalLeaves),
|
||||
|
||||
@ -479,6 +479,13 @@ func (e *AppConsensusEngine) validatePeerInfoMessage(
|
||||
return p2p.ValidationResultReject
|
||||
}
|
||||
|
||||
if peerInfo.Timestamp < now-1000 {
|
||||
e.logger.Debug("peer info timestamp too old, ignoring",
|
||||
zap.Int64("peer_timestamp", peerInfo.Timestamp),
|
||||
)
|
||||
return p2p.ValidationResultIgnore
|
||||
}
|
||||
|
||||
if peerInfo.Timestamp > fiveMinutesLater {
|
||||
e.logger.Debug("peer info timestamp too far in future",
|
||||
zap.Int64("peer_timestamp", peerInfo.Timestamp),
|
||||
@ -499,10 +506,17 @@ func (e *AppConsensusEngine) validatePeerInfoMessage(
|
||||
}
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
if int64(keyRegistry.LastUpdated) < now-1000 {
|
||||
e.logger.Debug("key registry timestamp too old")
|
||||
|
||||
if int64(keyRegistry.LastUpdated) < now-60000 {
|
||||
e.logger.Debug("key registry timestamp too old, rejecting")
|
||||
return p2p.ValidationResultReject
|
||||
}
|
||||
|
||||
if int64(keyRegistry.LastUpdated) < now-1000 {
|
||||
e.logger.Debug("key registry timestamp too old")
|
||||
return p2p.ValidationResultIgnore
|
||||
}
|
||||
|
||||
if int64(keyRegistry.LastUpdated) > now+5000 {
|
||||
e.logger.Debug("key registry timestamp too far in future")
|
||||
return p2p.ValidationResultIgnore
|
||||
|
||||
@ -504,13 +504,20 @@ func (e *GlobalConsensusEngine) validatePeerInfoMessage(
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
|
||||
if peerInfo.Timestamp < now-1000 {
|
||||
e.logger.Debug("peer info timestamp too old",
|
||||
if peerInfo.Timestamp < now-60000 {
|
||||
e.logger.Debug("peer info timestamp too old, rejecting",
|
||||
zap.Int64("peer_timestamp", peerInfo.Timestamp),
|
||||
)
|
||||
return tp2p.ValidationResultReject
|
||||
}
|
||||
|
||||
if peerInfo.Timestamp < now-1000 {
|
||||
e.logger.Debug("peer info timestamp too old, ignoring",
|
||||
zap.Int64("peer_timestamp", peerInfo.Timestamp),
|
||||
)
|
||||
return tp2p.ValidationResultIgnore
|
||||
}
|
||||
|
||||
if peerInfo.Timestamp > now+5000 {
|
||||
e.logger.Debug("peer info timestamp too far in future",
|
||||
zap.Int64("peer_timestamp", peerInfo.Timestamp),
|
||||
@ -532,9 +539,14 @@ func (e *GlobalConsensusEngine) validatePeerInfoMessage(
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
|
||||
if int64(keyRegistry.LastUpdated) < now-60000 {
|
||||
e.logger.Debug("key registry timestamp too old, rejecting")
|
||||
return tp2p.ValidationResultReject
|
||||
}
|
||||
|
||||
if int64(keyRegistry.LastUpdated) < now-1000 {
|
||||
e.logger.Debug("key registry timestamp too old")
|
||||
return tp2p.ValidationResultReject
|
||||
return tp2p.ValidationResultIgnore
|
||||
}
|
||||
|
||||
if int64(keyRegistry.LastUpdated) > now+5000 {
|
||||
|
||||
@ -406,6 +406,7 @@ func (p *SyncProvider[StateT, ProposalT]) HyperSync(
|
||||
phaseSyncs := [](func(
|
||||
protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
tries.ShardKey,
|
||||
[]byte,
|
||||
) []byte){
|
||||
p.hyperSyncVertexAdds,
|
||||
p.hyperSyncVertexRemoves,
|
||||
@ -438,7 +439,7 @@ func (p *SyncProvider[StateT, ProposalT]) HyperSync(
|
||||
return nil
|
||||
}
|
||||
|
||||
root := syncPhase(str, shardKey)
|
||||
root := syncPhase(str, shardKey, expectedRoot)
|
||||
if cerr := ch.Close(); cerr != nil {
|
||||
p.logger.Error("error while closing connection", zap.Error(cerr))
|
||||
}
|
||||
@ -480,6 +481,7 @@ func (p *SyncProvider[StateT, ProposalT]) HyperSyncSelf(
|
||||
phaseSyncs := [](func(
|
||||
protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
tries.ShardKey,
|
||||
[]byte,
|
||||
) []byte){
|
||||
p.hyperSyncVertexAdds,
|
||||
p.hyperSyncVertexRemoves,
|
||||
@ -511,7 +513,7 @@ func (p *SyncProvider[StateT, ProposalT]) HyperSyncSelf(
|
||||
return
|
||||
}
|
||||
|
||||
syncPhase(str, shardKey)
|
||||
syncPhase(str, shardKey, expectedRoot)
|
||||
if cerr := ch.Close(); cerr != nil {
|
||||
p.logger.Error("error while closing connection", zap.Error(cerr))
|
||||
}
|
||||
@ -524,65 +526,73 @@ func (p *SyncProvider[StateT, ProposalT]) HyperSyncSelf(
|
||||
func (p *SyncProvider[StateT, ProposalT]) hyperSyncVertexAdds(
|
||||
str protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
expectedRoot []byte,
|
||||
) []byte {
|
||||
err := p.hypergraph.SyncFrom(
|
||||
root, err := p.hypergraph.SyncFrom(
|
||||
str,
|
||||
shardKey,
|
||||
protobufs.HypergraphPhaseSet_HYPERGRAPH_PHASE_SET_VERTEX_ADDS,
|
||||
expectedRoot,
|
||||
)
|
||||
if err != nil {
|
||||
p.logger.Error("error from sync", zap.Error(err))
|
||||
}
|
||||
str.CloseSend()
|
||||
return nil
|
||||
return root
|
||||
}
|
||||
|
||||
func (p *SyncProvider[StateT, ProposalT]) hyperSyncVertexRemoves(
|
||||
str protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
expectedRoot []byte,
|
||||
) []byte {
|
||||
err := p.hypergraph.SyncFrom(
|
||||
root, err := p.hypergraph.SyncFrom(
|
||||
str,
|
||||
shardKey,
|
||||
protobufs.HypergraphPhaseSet_HYPERGRAPH_PHASE_SET_VERTEX_REMOVES,
|
||||
expectedRoot,
|
||||
)
|
||||
if err != nil {
|
||||
p.logger.Error("error from sync", zap.Error(err))
|
||||
}
|
||||
str.CloseSend()
|
||||
return nil
|
||||
return root
|
||||
}
|
||||
|
||||
func (p *SyncProvider[StateT, ProposalT]) hyperSyncHyperedgeAdds(
|
||||
str protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
expectedRoot []byte,
|
||||
) []byte {
|
||||
err := p.hypergraph.SyncFrom(
|
||||
root, err := p.hypergraph.SyncFrom(
|
||||
str,
|
||||
shardKey,
|
||||
protobufs.HypergraphPhaseSet_HYPERGRAPH_PHASE_SET_HYPEREDGE_ADDS,
|
||||
expectedRoot,
|
||||
)
|
||||
if err != nil {
|
||||
p.logger.Error("error from sync", zap.Error(err))
|
||||
}
|
||||
str.CloseSend()
|
||||
return nil
|
||||
return root
|
||||
}
|
||||
|
||||
func (p *SyncProvider[StateT, ProposalT]) hyperSyncHyperedgeRemoves(
|
||||
str protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
expectedRoot []byte,
|
||||
) []byte {
|
||||
err := p.hypergraph.SyncFrom(
|
||||
root, err := p.hypergraph.SyncFrom(
|
||||
str,
|
||||
shardKey,
|
||||
protobufs.HypergraphPhaseSet_HYPERGRAPH_PHASE_SET_HYPEREDGE_REMOVES,
|
||||
expectedRoot,
|
||||
)
|
||||
if err != nil {
|
||||
p.logger.Error("error from sync", zap.Error(err))
|
||||
}
|
||||
str.CloseSend()
|
||||
return nil
|
||||
return root
|
||||
}
|
||||
|
||||
func (p *SyncProvider[StateT, ProposalT]) AddState(
|
||||
|
||||
@ -186,8 +186,8 @@ func (r *DataWorkerIPCServer) RespawnServer(filter []byte) error {
|
||||
"quilibrium.node.global.pb.KeyRegistryService": channel.OnlySelfPeer,
|
||||
},
|
||||
map[string]channel.AllowedPeerPolicyType{
|
||||
"/quilibrium.node.application.pb.HypergraphComparisonService/HyperStream": channel.OnlyShardProverPeer,
|
||||
"/quilibrium.node.application.pb.HypergraphComparisonService/PerformSync": channel.OnlyShardProverPeer,
|
||||
"/quilibrium.node.application.pb.HypergraphComparisonService/HyperStream": channel.OnlyShardProverPeer,
|
||||
"/quilibrium.node.application.pb.HypergraphComparisonService/PerformSync": channel.OnlyShardProverPeer,
|
||||
"/quilibrium.node.global.pb.MixnetService/GetTag": channel.AnyPeer,
|
||||
"/quilibrium.node.global.pb.MixnetService/PutTag": channel.AnyPeer,
|
||||
"/quilibrium.node.global.pb.MixnetService/PutMessage": channel.AnyPeer,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1531,6 +1531,10 @@ type HypergraphSyncGetBranchRequest struct {
|
||||
PhaseSet HypergraphPhaseSet `protobuf:"varint,2,opt,name=phase_set,json=phaseSet,proto3,enum=quilibrium.node.application.pb.HypergraphPhaseSet" json:"phase_set,omitempty"`
|
||||
// The path to query. Empty path queries the root.
|
||||
Path []int32 `protobuf:"varint,3,rep,packed,name=path,proto3" json:"path,omitempty"`
|
||||
// The expected root commitment the client wants to sync against. When set,
|
||||
// the server will attempt to find a snapshot with a matching root. If empty,
|
||||
// the server uses the latest available snapshot.
|
||||
ExpectedRoot []byte `protobuf:"bytes,4,opt,name=expected_root,json=expectedRoot,proto3" json:"expected_root,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HypergraphSyncGetBranchRequest) Reset() {
|
||||
@ -1586,6 +1590,13 @@ func (x *HypergraphSyncGetBranchRequest) GetPath() []int32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HypergraphSyncGetBranchRequest) GetExpectedRoot() []byte {
|
||||
if x != nil {
|
||||
return x.ExpectedRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// HypergraphSyncBranchResponse contains branch information at the queried path.
|
||||
type HypergraphSyncBranchResponse struct {
|
||||
state protoimpl.MessageState
|
||||
@ -1746,6 +1757,10 @@ type HypergraphSyncGetLeavesRequest struct {
|
||||
MaxLeaves uint32 `protobuf:"varint,4,opt,name=max_leaves,json=maxLeaves,proto3" json:"max_leaves,omitempty"`
|
||||
// Continuation token for pagination. Empty for first request.
|
||||
ContinuationToken []byte `protobuf:"bytes,5,opt,name=continuation_token,json=continuationToken,proto3" json:"continuation_token,omitempty"`
|
||||
// The expected root commitment the client wants to sync against. When set,
|
||||
// the server will attempt to find a snapshot with a matching root. If empty,
|
||||
// the server uses the latest available snapshot.
|
||||
ExpectedRoot []byte `protobuf:"bytes,6,opt,name=expected_root,json=expectedRoot,proto3" json:"expected_root,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HypergraphSyncGetLeavesRequest) Reset() {
|
||||
@ -1815,6 +1830,13 @@ func (x *HypergraphSyncGetLeavesRequest) GetContinuationToken() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HypergraphSyncGetLeavesRequest) GetExpectedRoot() []byte {
|
||||
if x != nil {
|
||||
return x.ExpectedRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// HypergraphSyncLeavesResponse contains leaves from the requested subtree.
|
||||
type HypergraphSyncLeavesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
@ -2159,7 +2181,7 @@ var file_application_proto_rawDesc = []byte{
|
||||
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65,
|
||||
0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48,
|
||||
0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x01, 0x0a, 0x1e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc7, 0x01, 0x0a, 0x1e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72,
|
||||
0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x47, 0x65, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72, 0x64,
|
||||
0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x68, 0x61, 0x72,
|
||||
@ -2169,124 +2191,128 @@ var file_application_proto_rawDesc = []byte{
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72,
|
||||
0x61, 0x70, 0x68, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x70, 0x68, 0x61,
|
||||
0x73, 0x65, 0x53, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20,
|
||||
0x03, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xe8, 0x01, 0x0a, 0x1c, 0x48, 0x79,
|
||||
0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x42, 0x72, 0x61, 0x6e,
|
||||
0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75,
|
||||
0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x66,
|
||||
0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
|
||||
0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6d,
|
||||
0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64,
|
||||
0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x71, 0x75, 0x69, 0x6c,
|
||||
0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c,
|
||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72,
|
||||
0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x07,
|
||||
0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69,
|
||||
0x73, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x43,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x22, 0x4f, 0x0a, 0x17, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61,
|
||||
0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||
0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69,
|
||||
0x74, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xf0, 0x01, 0x0a, 0x1e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67,
|
||||
0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x76, 0x65,
|
||||
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x72,
|
||||
0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x68, 0x61,
|
||||
0x72, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x4f, 0x0a, 0x09, 0x70, 0x68, 0x61, 0x73, 0x65, 0x5f, 0x73,
|
||||
0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69,
|
||||
0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69,
|
||||
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67,
|
||||
0x72, 0x61, 0x70, 0x68, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x70, 0x68,
|
||||
0x61, 0x73, 0x65, 0x53, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03,
|
||||
0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61,
|
||||
0x78, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09,
|
||||
0x6d, 0x61, 0x78, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xc6, 0x01, 0x0a, 0x1c, 0x48, 0x79, 0x70,
|
||||
0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x65, 0x61, 0x76, 0x65,
|
||||
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
|
||||
0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x40, 0x0a,
|
||||
0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e,
|
||||
0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e,
|
||||
0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x4c,
|
||||
0x65, 0x61, 0x66, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12,
|
||||
0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
|
||||
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21,
|
||||
0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x76, 0x65,
|
||||
0x73, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68,
|
||||
0x53, 0x79, 0x6e, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x4b, 0x0a, 0x04, 0x63, 0x6f, 0x64,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62,
|
||||
0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72,
|
||||
0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,
|
||||
0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04,
|
||||
0x70, 0x61, 0x74, 0x68, 0x2a, 0xb8, 0x01, 0x0a, 0x12, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72,
|
||||
0x61, 0x70, 0x68, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x20, 0x48,
|
||||
0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x5f,
|
||||
0x53, 0x45, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x45, 0x58, 0x5f, 0x41, 0x44, 0x44, 0x53, 0x10,
|
||||
0x00, 0x12, 0x27, 0x0a, 0x23, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f,
|
||||
0x50, 0x48, 0x41, 0x53, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x45, 0x58,
|
||||
0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x53, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x48, 0x59,
|
||||
0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x5f, 0x53,
|
||||
0x45, 0x54, 0x5f, 0x48, 0x59, 0x50, 0x45, 0x52, 0x45, 0x44, 0x47, 0x45, 0x5f, 0x41, 0x44, 0x44,
|
||||
0x53, 0x10, 0x02, 0x12, 0x2a, 0x0a, 0x26, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50,
|
||||
0x48, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x48, 0x59, 0x50, 0x45,
|
||||
0x52, 0x45, 0x44, 0x47, 0x45, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x53, 0x10, 0x03, 0x2a,
|
||||
0x8f, 0x02, 0x0a, 0x17, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79,
|
||||
0x6e, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x48,
|
||||
0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45,
|
||||
0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x2b,
|
||||
0x0a, 0x27, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e,
|
||||
0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f,
|
||||
0x53, 0x48, 0x41, 0x52, 0x44, 0x5f, 0x4b, 0x45, 0x59, 0x10, 0x01, 0x12, 0x26, 0x0a, 0x22, 0x48,
|
||||
0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45,
|
||||
0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x41, 0x54,
|
||||
0x48, 0x10, 0x02, 0x12, 0x28, 0x0a, 0x24, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50,
|
||||
0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x44,
|
||||
0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x03, 0x12, 0x2e, 0x0a,
|
||||
0x2a, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43,
|
||||
0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x5f,
|
||||
0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x22, 0x0a,
|
||||
0x1e, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43,
|
||||
0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10,
|
||||
0x05, 0x32, 0xaa, 0x03, 0x0a, 0x1b, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68,
|
||||
0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x7d, 0x0a, 0x0b, 0x48, 0x79, 0x70, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||
0x12, 0x34, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f,
|
||||
0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
|
||||
0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43, 0x6f, 0x6d, 0x70,
|
||||
0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72,
|
||||
0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61,
|
||||
0x70, 0x68, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x28, 0x01, 0x30, 0x01,
|
||||
0x12, 0x8b, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e,
|
||||
0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x39, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62,
|
||||
0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x69, 0x6c,
|
||||
0x64, 0x72, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e,
|
||||
0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x46,
|
||||
0x6f, 0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7e,
|
||||
0x0a, 0x0b, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x33, 0x2e,
|
||||
0x03, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x70,
|
||||
0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x52, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xe8,
|
||||
0x01, 0x0a, 0x1c, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e,
|
||||
0x63, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x05, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1e, 0x0a, 0x0a,
|
||||
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x08,
|
||||
0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37,
|
||||
0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
|
||||
0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e,
|
||||
0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68,
|
||||
0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65,
|
||||
0x6e, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65,
|
||||
0x61, 0x66, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09,
|
||||
0x6c, 0x65, 0x61, 0x66, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x4f, 0x0a, 0x17, 0x48, 0x79, 0x70,
|
||||
0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x69, 0x6c, 0x64,
|
||||
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f,
|
||||
0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a,
|
||||
0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x95, 0x02, 0x0a, 0x1e, 0x48,
|
||||
0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x47, 0x65, 0x74,
|
||||
0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a,
|
||||
0x09, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x52, 0x08, 0x73, 0x68, 0x61, 0x72, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x4f, 0x0a, 0x09, 0x70, 0x68,
|
||||
0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e,
|
||||
0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e,
|
||||
0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48,
|
||||
0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x75, 0x65,
|
||||
0x72, 0x79, 0x1a, 0x36, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e,
|
||||
0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79,
|
||||
0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x3a,
|
||||
0x5a, 0x38, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72,
|
||||
0x69, 0x75, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69,
|
||||
0x75, 0x6d, 0x2f, 0x6d, 0x6f, 0x6e, 0x6f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x50, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65,
|
||||
0x74, 0x52, 0x08, 0x70, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70,
|
||||
0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12,
|
||||
0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x2d,
|
||||
0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74,
|
||||
0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a,
|
||||
0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f,
|
||||
0x6f, 0x74, 0x22, 0xc6, 0x01, 0x0a, 0x1c, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70,
|
||||
0x68, 0x53, 0x79, 0x6e, 0x63, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||
0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x40, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65,
|
||||
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62,
|
||||
0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x65, 0x61, 0x66, 0x44, 0x61, 0x74,
|
||||
0x61, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x69, 0x6e, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61,
|
||||
0x6c, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b,
|
||||
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x13,
|
||||
0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x72,
|
||||
0x72, 0x6f, 0x72, 0x12, 0x4b, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0e, 0x32, 0x37, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e,
|
||||
0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
|
||||
0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e,
|
||||
0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
|
||||
0x74, 0x68, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x2a, 0xb8,
|
||||
0x01, 0x0a, 0x12, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x50, 0x68, 0x61,
|
||||
0x73, 0x65, 0x53, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x20, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52,
|
||||
0x41, 0x50, 0x48, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x56, 0x45,
|
||||
0x52, 0x54, 0x45, 0x58, 0x5f, 0x41, 0x44, 0x44, 0x53, 0x10, 0x00, 0x12, 0x27, 0x0a, 0x23, 0x48,
|
||||
0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x5f,
|
||||
0x53, 0x45, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x54, 0x45, 0x58, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56,
|
||||
0x45, 0x53, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41,
|
||||
0x50, 0x48, 0x5f, 0x50, 0x48, 0x41, 0x53, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x48, 0x59, 0x50,
|
||||
0x45, 0x52, 0x45, 0x44, 0x47, 0x45, 0x5f, 0x41, 0x44, 0x44, 0x53, 0x10, 0x02, 0x12, 0x2a, 0x0a,
|
||||
0x26, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x50, 0x48, 0x41, 0x53,
|
||||
0x45, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x48, 0x59, 0x50, 0x45, 0x52, 0x45, 0x44, 0x47, 0x45, 0x5f,
|
||||
0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x53, 0x10, 0x03, 0x2a, 0x8f, 0x02, 0x0a, 0x17, 0x48, 0x79,
|
||||
0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x45, 0x72, 0x72, 0x6f,
|
||||
0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52,
|
||||
0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55,
|
||||
0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x2b, 0x0a, 0x27, 0x48, 0x59, 0x50, 0x45,
|
||||
0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f,
|
||||
0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x48, 0x41, 0x52, 0x44, 0x5f,
|
||||
0x4b, 0x45, 0x59, 0x10, 0x01, 0x12, 0x26, 0x0a, 0x22, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52,
|
||||
0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49,
|
||||
0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x10, 0x02, 0x12, 0x28, 0x0a,
|
||||
0x24, 0x48, 0x59, 0x50, 0x45, 0x52, 0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43,
|
||||
0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f,
|
||||
0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x03, 0x12, 0x2e, 0x0a, 0x2a, 0x48, 0x59, 0x50, 0x45, 0x52,
|
||||
0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52,
|
||||
0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49,
|
||||
0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x22, 0x0a, 0x1e, 0x48, 0x59, 0x50, 0x45, 0x52,
|
||||
0x47, 0x52, 0x41, 0x50, 0x48, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52,
|
||||
0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x05, 0x32, 0xaa, 0x03, 0x0a, 0x1b,
|
||||
0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72,
|
||||
0x69, 0x73, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x0b, 0x48,
|
||||
0x79, 0x70, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x34, 0x2e, 0x71, 0x75, 0x69,
|
||||
0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70,
|
||||
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65,
|
||||
0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e,
|
||||
0x1a, 0x34, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f,
|
||||
0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
|
||||
0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43, 0x6f, 0x6d, 0x70,
|
||||
0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x28, 0x01, 0x30, 0x01, 0x12, 0x8b, 0x01, 0x0a, 0x12, 0x47,
|
||||
0x65, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74,
|
||||
0x68, 0x12, 0x39, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e,
|
||||
0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
|
||||
0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x46, 0x6f,
|
||||
0x72, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x71,
|
||||
0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61,
|
||||
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65,
|
||||
0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x50, 0x61, 0x74, 0x68,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7e, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x66,
|
||||
0x6f, 0x72, 0x6d, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x33, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62,
|
||||
0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79, 0x70, 0x65, 0x72, 0x67, 0x72,
|
||||
0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x36, 0x2e, 0x71,
|
||||
0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61,
|
||||
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x79,
|
||||
0x70, 0x65, 0x72, 0x67, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x3a, 0x5a, 0x38, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x2e, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x71, 0x75, 0x69, 0x6c, 0x69, 0x62, 0x72, 0x69, 0x75, 0x6d, 0x2f, 0x6d, 0x6f, 0x6e,
|
||||
0x6f, 0x72, 0x65, 0x70, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@ -213,6 +213,10 @@ message HypergraphSyncGetBranchRequest {
|
||||
HypergraphPhaseSet phase_set = 2;
|
||||
// The path to query. Empty path queries the root.
|
||||
repeated int32 path = 3;
|
||||
// The expected root commitment the client wants to sync against. When set,
|
||||
// the server will attempt to find a snapshot with a matching root. If empty,
|
||||
// the server uses the latest available snapshot.
|
||||
bytes expected_root = 4;
|
||||
}
|
||||
|
||||
// HypergraphSyncBranchResponse contains branch information at the queried path.
|
||||
@ -250,6 +254,10 @@ message HypergraphSyncGetLeavesRequest {
|
||||
uint32 max_leaves = 4;
|
||||
// Continuation token for pagination. Empty for first request.
|
||||
bytes continuation_token = 5;
|
||||
// The expected root commitment the client wants to sync against. When set,
|
||||
// the server will attempt to find a snapshot with a matching root. If empty,
|
||||
// the server uses the latest available snapshot.
|
||||
bytes expected_root = 6;
|
||||
}
|
||||
|
||||
// HypergraphSyncLeavesResponse contains leaves from the requested subtree.
|
||||
|
||||
@ -297,12 +297,15 @@ type Hypergraph interface {
|
||||
|
||||
// SyncFrom is the client-side initiator for synchronization using the
|
||||
// client-driven protocol. The client navigates the server's tree and
|
||||
// fetches differing data.
|
||||
// fetches differing data. If expectedRoot is provided, the server will
|
||||
// attempt to sync from a snapshot matching that root commitment.
|
||||
// Returns the new root commitment after sync completes.
|
||||
SyncFrom(
|
||||
stream protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
) error
|
||||
expectedRoot []byte,
|
||||
) ([]byte, error)
|
||||
|
||||
// Transaction and utility operations
|
||||
|
||||
|
||||
@ -212,9 +212,13 @@ func (h *MockHypergraph) SyncFrom(
|
||||
stream protobufs.HypergraphComparisonService_PerformSyncClient,
|
||||
shardKey tries.ShardKey,
|
||||
phaseSet protobufs.HypergraphPhaseSet,
|
||||
) error {
|
||||
args := h.Called(stream, shardKey, phaseSet)
|
||||
return args.Error(0)
|
||||
expectedRoot []byte,
|
||||
) ([]byte, error) {
|
||||
args := h.Called(stream, shardKey, phaseSet, expectedRoot)
|
||||
if args.Get(0) == nil {
|
||||
return nil, args.Error(1)
|
||||
}
|
||||
return args.Get(0).([]byte), args.Error(1)
|
||||
}
|
||||
|
||||
// RunDataPruning implements hypergraph.Hypergraph.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user