Skip to content

Commit

Permalink
v0.22 merge master (#1405)
Browse files Browse the repository at this point in the history
* fvm bench test

* bench test upgrade

* add create account and ft transfer bench

* Add a comparative bench

* adb more benchmarks

* review fixes

* increase benchmarking string length

* Use single programs instance

* fix lint issues and revert unnecesary changes

* refactor - part1

* refactor - part 2

* let batchNFT benchmark accept block executor

* Enable transaction fees on mainnet

* restrict fees to mainnet testnet and canary

* Update peerManager.go

* fix bug

* Update peerManager.go

* [Consensus] fix startup time (#1402)

* fix startup time

* remove log from debugging

* merge master

Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com>
Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
Co-authored-by: ramtinms <ramtin@axiomzen.co>
Co-authored-by: Ramtin M. Seraj <ramtinms@users.noreply.github.com>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: Simon Zhu <simon.zsiyan@gmail.com>
  • Loading branch information
7 people committed Oct 1, 2021
1 parent 467add6 commit 6d99469
Show file tree
Hide file tree
Showing 8 changed files with 1,041 additions and 30 deletions.
21 changes: 10 additions & 11 deletions cmd/collection/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,29 +143,28 @@ func main() {
"additional fraction of replica timeout that the primary will wait for votes")
flags.DurationVar(&blockRateDelay, "block-rate-delay", 250*time.Millisecond,
"the delay to broadcast block proposal in order to control block production rate")
flags.StringVar(&startupTimeString, "hotstuff-startup-time", cmd.NotSet, "specifies date and time (in ISO 8601 format) after which the consensus participant may enter the first view (e.g 2006-01-02T15:04:05Z07:00)")
flags.StringVar(&startupTimeString, "hotstuff-startup-time", cmd.NotSet, "specifies date and time (in ISO 8601 format) after which the consensus participant may enter the first view (e.g (e.g 1996-04-24T15:04:05-07:00))")

// epoch qc contract flags
flags.StringVar(&accessAddress, "access-address", "", "the address of an access node")
flags.StringVar(&secureAccessNodeID, "secure-access-node-id", "", "the node ID of the secure access GRPC server")
flags.BoolVar(&insecureAccessAPI, "insecure-access-api", true, "required if insecure GRPC connection should be used")
}).ValidateFlags(func() error {
if startupTimeString != cmd.NotSet {
t, err := time.Parse(time.RFC3339, startupTimeString)
if err != nil {
return fmt.Errorf("invalid start-time value: %w", err)
}
startupTime = t
}
return nil
})

if err = nodeBuilder.Initialize(); err != nil {
nodeBuilder.Logger.Fatal().Err(err).Send()
}

nodeBuilder.
ValidateFlags(func() error {
if startupTimeString != cmd.NotSet {
t, err := time.Parse(time.RFC3339, startupTimeString)
if err != nil {
return fmt.Errorf("invalid start-time value: %w", err)
}
startupTime = t
}
return nil
}).
Module("mutable follower state", func(builder cmd.NodeBuilder, node *cmd.NodeConfig) error {
// For now, we only support state implementations from package badger.
// If we ever support different implementations, the following can be replaced by a type-aware factory
Expand Down
23 changes: 12 additions & 11 deletions cmd/consensus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,25 @@ func main() {
flags.DurationVar(&dkgControllerConfig.BaseStartDelay, "dkg-controller-base-start-delay", dkgmodule.DefaultBaseStartDelay, "used to define the range for jitter prior to DKG start (eg. 500µs) - the base value is scaled quadratically with the # of DKG participants")
flags.DurationVar(&dkgControllerConfig.BaseHandleFirstBroadcastDelay, "dkg-controller-base-handle-first-broadcast-delay", dkgmodule.DefaultBaseHandleFirstBroadcastDelay, "used to define the range for jitter prior to DKG handling the first broadcast messages (eg. 50ms) - the base value is scaled quadratically with the # of DKG participants")
flags.DurationVar(&dkgControllerConfig.HandleSubsequentBroadcastDelay, "dkg-controller-handle-subsequent-broadcast-delay", dkgmodule.DefaultHandleSubsequentBroadcastDelay, "used to define the constant delay introduced prior to DKG handling subsequent broadcast messages (eg. 2s)")
flags.StringVar(&startupTimeString, "hotstuff-startup-time", cmd.NotSet, "specifies date and time (in ISO 8601 format) after which the consensus participant may enter the first view (e.g 2006-01-02T15:04:05Z07:00)")
flags.StringVar(&startupTimeString, "hotstuff-startup-time", cmd.NotSet, "specifies date and time (in ISO 8601 format) after which the consensus participant may enter the first view (e.g 1996-04-24T15:04:05-07:00)")
}).ValidateFlags(func() error {
nodeBuilder.Logger.Info().Str("startup_time_str", startupTimeString).Msg("got startup_time_str")
if startupTimeString != cmd.NotSet {
t, err := time.Parse(time.RFC3339, startupTimeString)
if err != nil {
return fmt.Errorf("invalid start-time value: %w", err)
}
startupTime = t
nodeBuilder.Logger.Info().Time("startup_time", startupTime).Msg("got startup_time")
}
return nil
})

if err = nodeBuilder.Initialize(); err != nil {
nodeBuilder.Logger.Fatal().Err(err).Send()
}

nodeBuilder.
ValidateFlags(func() error {
if startupTimeString != cmd.NotSet {
t, err := time.Parse(time.RFC3339, startupTimeString)
if err != nil {
return fmt.Errorf("invalid start-time value: %w", err)
}
startupTime = t
}
return nil
}).
Module("consensus node metrics", func(builder cmd.NodeBuilder, node *cmd.NodeConfig) error {
conMetrics = metrics.NewConsensusCollector(node.Tracer, node.MetricsRegisterer)
return nil
Expand Down
4 changes: 3 additions & 1 deletion cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,9 @@ func (fnb *FlowNodeBuilder) initFvmOptions() {
fvm.WithChain(fnb.RootChainID.Chain()),
fvm.WithBlocks(blockFinder),
fvm.WithAccountStorageLimit(true),
fvm.WithTransactionFeesEnabled(true),
}
if fnb.RootChainID == flow.Testnet || fnb.RootChainID == flow.Canary || fnb.RootChainID == flow.Mainnet {
fvm.WithTransactionFeesEnabled(true)
}
if fnb.RootChainID == flow.Testnet || fnb.RootChainID == flow.Canary {
vmOpts = append(vmOpts,
Expand Down
5 changes: 3 additions & 2 deletions engine/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ func (u *Unit) LaunchAfter(delay time.Duration, f func()) {
// If f is executed, the unit will not shut down until after f returns.
func (u *Unit) LaunchPeriodically(f func(), interval time.Duration, delay time.Duration) {
u.Launch(func() {
ticker := time.NewTicker(interval)
defer ticker.Stop()

select {
case <-u.ctx.Done():
return
case <-time.After(delay):
}

ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
select {
case <-u.ctx.Done():
Expand Down

0 comments on commit 6d99469

Please sign in to comment.