Commit d7ff21d5 authored by masala's avatar masala

remove var epoch period

parent aacc0c23
......@@ -24,13 +24,11 @@ import (
"os"
"path/filepath"
"sync"
"time"
"github.com/katzenpost/authority/voting/server/config"
"github.com/katzenpost/core/crypto/ecdh"
"github.com/katzenpost/core/crypto/eddsa"
"github.com/katzenpost/core/crypto/rand"
"github.com/katzenpost/core/epochtime"
"github.com/katzenpost/core/log"
"gopkg.in/op/go-logging.v1"
)
......@@ -230,9 +228,6 @@ func New(cfg *config.Config) (*Server, error) {
return nil, fmt.Errorf("server: Insufficient nodes whitelisted, got %v , need %v", len(cfg.Mixes), cfg.Debug.Layers*cfg.Debug.MinNodesPerLayer)
}
// Set the Epoch Period from the configuration file.
epochtime.Period = cfg.Parameters.EpochPeriod * time.Second
// Past this point, failures need to call s.Shutdown() to do cleanup.
isOk := false
defer func() {
......
......@@ -50,13 +50,17 @@ import (
)
const (
descriptorsBucket = "descriptors"
documentsBucket = "documents"
stateAcceptDescriptor = "accept_desc"
stateAcceptVote = "accept_vote"
stateAcceptReveal = "accept_reveal"
stateAcceptSignature = "accept_signature"
stateBootstrap = "bootstrap"
descriptorsBucket = "descriptors"
documentsBucket = "documents"
stateAcceptDescriptor = "accept_desc"
stateAcceptVote = "accept_vote"
stateAcceptReveal = "accept_reveal"
stateAcceptSignature = "accept_signature"
stateBootstrap = "bootstrap"
mixPublishDeadline = epochtime.Period / 2
authorityVoteDeadline = mixPublishDeadline + epochtime.Period/8
authorityRevealDeadline = authorityVoteDeadline + epochtime.Period/8
publishConsensusDeadline = authorityRevealDeadline + epochtime.Period/8
)
var (
......@@ -64,10 +68,6 @@ var (
errNotYet = errors.New("authority: Document is not ready yet")
)
var (
mixPublishDeadline, authorityVoteDeadline, authorityRevealDeadline, publishConsensusDeadline time.Duration
)
type descriptor struct {
desc *pki.MixDescriptor
raw []byte
......@@ -1191,8 +1191,7 @@ func (s *state) onDescriptorUpload(rawDesc []byte, desc *pki.MixDescriptor, epoc
}
func (s *state) documentForEpoch(epoch uint64) ([]byte, error) {
//const generationDeadline = 45 * time.Minute
var generationDeadline = 7 * epochtime.Period / 8
const generationDeadline = 7 * epochtime.Period / 8
s.RLock()
defer s.RUnlock()
......@@ -1350,10 +1349,6 @@ func newState(s *Server) (*state, error) {
st.log = s.logBackend.GetLogger("state")
// set voting schedule at runtime
mixPublishDeadline = epochtime.Period / 2
authorityVoteDeadline = mixPublishDeadline + epochtime.Period/8
authorityRevealDeadline = authorityVoteDeadline + epochtime.Period/8
publishConsensusDeadline = authorityRevealDeadline + epochtime.Period/8
st.log.Debugf("State initialized with epoch Period: %s", epochtime.Period)
st.log.Debugf("State initialized with mixPublishDeadline: %s", mixPublishDeadline)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment