Skip to content

Commit

Permalink
rename serv -> server
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjit-bhat committed Jun 21, 2024
1 parent eaaabfc commit aeaba12
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions ktmerkle/ktmerkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (ts *timeSeries) get(epoch epochTy) (merkle.Val, bool, cryptoffi.Sig, bool)

// KT server.

type serv struct {
type server struct {
sk cryptoffi.PrivateKey
mu *sync.Mutex
trees []*merkle.Tree
Expand All @@ -104,7 +104,7 @@ type serv struct {
changed map[string]bool
}

func newServ() (*serv, cryptoffi.PublicKey) {
func newServer() (*server, cryptoffi.PublicKey) {
sk, pk := cryptoffi.MakeKeys()
mu := new(sync.Mutex)
nextTr := &merkle.Tree{}
Expand All @@ -120,10 +120,10 @@ func newServ() (*serv, cryptoffi.PublicKey) {
sig := cryptoffi.Sign(sk, enc)
var sigs []cryptoffi.Sig
sigs = append(sigs, sig)
return &serv{sk: sk, mu: mu, trees: trees, nextTr: nextTr, chain: chain, linkSigs: sigs, changed: changed}, pk
return &server{sk: sk, mu: mu, trees: trees, nextTr: nextTr, chain: chain, linkSigs: sigs, changed: changed}, pk
}

func (s *serv) updateEpoch() {
func (s *server) updateEpoch() {
s.mu.Lock()
commitTr := s.nextTr
s.nextTr = commitTr.DeepCopy()
Expand All @@ -141,7 +141,7 @@ func (s *serv) updateEpoch() {
}

// put schedules a put to be committed at the next epoch update.
func (s *serv) put(id merkle.Id, val merkle.Val) *servPutReply {
func (s *server) put(id merkle.Id, val merkle.Val) *servPutReply {
s.mu.Lock()
errReply := &servPutReply{}
errReply.error = errSome
Expand Down Expand Up @@ -170,7 +170,7 @@ func (s *serv) put(id merkle.Id, val merkle.Val) *servPutReply {
return &servPutReply{putEpoch: currEpoch + 1, prev2Link: prev2Link, prevDig: prevDig, linkSig: linkSig, putSig: putSig, error: errNone}
}

func (s *serv) getIdAt(id merkle.Id, epoch epochTy) *servGetIdAtReply {
func (s *server) getIdAt(id merkle.Id, epoch epochTy) *servGetIdAtReply {
s.mu.Lock()
errReply := &servGetIdAtReply{}
errReply.error = errSome
Expand All @@ -197,7 +197,7 @@ func (s *serv) getIdNow(id merkle.Id) *servGetIdNowReply {
}
*/

func (s *serv) getLink(epoch epochTy) *servGetLinkReply {
func (s *server) getLink(epoch epochTy) *servGetLinkReply {
s.mu.Lock()
if epoch >= uint64(len(s.trees)) {
errReply := &servGetLinkReply{}
Expand Down
2 changes: 1 addition & 1 deletion ktmerkle/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func testAgreement(servAddr, adtr0Addr, adtr1Addr grove_ffi.Address) {
// Start server and two auditors.
serv, servPk := newServ()
serv, servPk := newServer()
helpers := &helpersTy{servPk: servPk}
go func() {
serv.start(servAddr)
Expand Down
2 changes: 1 addition & 1 deletion ktmerkle/rpc_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func callServGetLink(cli *urpc.Client, epoch epochTy) *servGetLinkReply {
return reply
}

func (s *serv) start(addr grove_ffi.Address) {
func (s *server) start(addr grove_ffi.Address) {
handlers := make(map[uint64]func([]byte, *[]byte))

handlers[rpcServUpdateEpoch] =
Expand Down

0 comments on commit aeaba12

Please sign in to comment.