Skip to content

Commit

Permalink
Merge branch 'master' into AndriiSlisarchuk/5788-version-control-module
Browse files Browse the repository at this point in the history
  • Loading branch information
Guitarheroua authored Jun 25, 2024
2 parents 99a9f45 + 3126f9a commit 5a52d61
Show file tree
Hide file tree
Showing 47 changed files with 1,721 additions and 190 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- Preserve
- Idea
# Label to use when marking an issue as stale
staleLabel: Stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
name: 'Mark and close stale issues'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-issue-stale: 90
days-before-issue-close: 7
exempt-issue-labels: 'Preserve,Idea'
stale-issue-label: 'Stale'
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
5 changes: 5 additions & 0 deletions cmd/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,11 @@ func (fnb *FlowNodeBuilder) EnqueueNetworkInit() {
peerManagerFilters)
})

fnb.Module("epoch transition logger", func(node *NodeConfig) error {
node.ProtocolEvents.AddConsumer(events.NewEventLogger(node.Logger))
return nil
})

fnb.Module("network underlay dependency", func(node *NodeConfig) error {
fnb.networkUnderlayDependable = module.NewProxiedReadyDoneAware()
fnb.PeerManagerDependencies.Add(fnb.networkUnderlayDependable)
Expand Down
14 changes: 14 additions & 0 deletions cmd/util/cmd/diff-states/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
flagStateCommitment1 string
flagStateCommitment2 string
flagRaw bool
flagAlwaysDiffValues bool
flagNWorker int
flagChain string
)
Expand Down Expand Up @@ -113,6 +114,13 @@ func init() {
"Raw or value",
)

Cmd.Flags().BoolVar(
&flagAlwaysDiffValues,
"always-diff-values",
false,
"always diff on value level. useful when trying to test iteration, by diffing same state.",
)

Cmd.Flags().IntVar(
&flagNWorker,
"n-worker",
Expand Down Expand Up @@ -294,6 +302,8 @@ func diffAccount(
})
}

diffValues := flagAlwaysDiffValues

err = accountRegisters1.ForEach(func(owner, key string, value1 []byte) error {
var value2 []byte
value2, err = accountRegisters2.Get(owner, key)
Expand Down Expand Up @@ -323,6 +333,10 @@ func diffAccount(
return err
}

diffValues = true
}

if diffValues {
address, err := common.BytesToAddress([]byte(owner))
if err != nil {
return err
Expand Down
15 changes: 15 additions & 0 deletions cmd/util/cmd/execution-state-extract/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path"
"runtime/pprof"
"strings"

"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -178,6 +179,20 @@ func init() {
}

func run(*cobra.Command, []string) {
if flagCPUProfile != "" {
f, err := os.Create(flagCPUProfile)
if err != nil {
log.Fatal().Err(err).Msg("could not create CPU profile")
}

err = pprof.StartCPUProfile(f)
if err != nil {
log.Fatal().Err(err).Msg("could not start CPU profile")
}

defer pprof.StopCPUProfile()
}

var stateCommitment flow.StateCommitment

if len(flagBlockHash) > 0 && len(flagStateCommitment) > 0 {
Expand Down
14 changes: 0 additions & 14 deletions cmd/util/cmd/execution-state-extract/execution_state_extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"math"
"os"
"runtime/pprof"
syncAtomic "sync/atomic"
"time"

Expand Down Expand Up @@ -325,19 +324,6 @@ func newMigration(
nWorker int,
) ledger.Migration {
return func(payloads []*ledger.Payload) ([]*ledger.Payload, error) {
if flagCPUProfile != "" {
f, err := os.Create(flagCPUProfile)
if err != nil {
logger.Fatal().Err(err).Msg("could not create CPU profile")
}

err = pprof.StartCPUProfile(f)
if err != nil {
logger.Fatal().Err(err).Msg("could not start CPU profile")
}

defer pprof.StopCPUProfile()
}

if len(migrations) == 0 {
return payloads, nil
Expand Down
Loading

0 comments on commit 5a52d61

Please sign in to comment.