Skip to content

Commit

Permalink
Merge branch 'master' into antithesis-image-build-reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
marun authored Jul 29, 2024
2 parents 00230cd + ccf785c commit f3c96be
Show file tree
Hide file tree
Showing 63 changed files with 940 additions and 450 deletions.
1 change: 0 additions & 1 deletion .github/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ self-hosted-runner:
labels:
- custom-arm64-focal
- custom-arm64-jammy
- net-outage-sim
13 changes: 0 additions & 13 deletions .github/workflows/cleanup-net-outage-sim.sh

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run fuzz tests

on:
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * *" # Once a day at midnight UTC

permissions:
contents: read
Expand All @@ -13,8 +13,6 @@ jobs:
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: 'dev'
- name: Set up Go
uses: ./.github/actions/setup-go-for-project
- name: Run fuzz tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/fuzz_merkledb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: 'dev'
- name: Set up Go
uses: ./.github/actions/setup-go-for-project
- name: Run merkledb fuzz tests
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/net-outage-sim.yml

This file was deleted.

99 changes: 0 additions & 99 deletions .github/workflows/run-net-outage-sim.sh

This file was deleted.

64 changes: 64 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
# Release Notes

## [v1.11.10](https://github.com/ava-labs/avalanchego/releases/tag/v1.11.10)

This version is backwards compatible to [v1.11.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.11.0). It is optional, but encouraged.

The plugin version is updated to `36` all plugins must update to be compatible.

### APIs

- Renamed `avalanche_{vmName}_plugin_.*` metrics to `avalanche_{vmName}_.*`
- Renamed `avalanche_{vmName}_rpcchainvm_.*` metrics to `avalanche_rpcchainvm_.*`

### Fixes

- Updated local network validator start times
- Fixed block building timer recalculation when anyone can propose

### What's Changed

- Refactor rpcchainvm metrics registration by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3170
- Add example reward calculator usage by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3171
- Send AppErrors from p2p SDK by @joshua-kim in https://github.com/ava-labs/avalanchego/pull/2753
- build(tests): require `//go:build test` tag if importing test packages outside of `_test.go` files by @ARR4N in https://github.com/ava-labs/avalanchego/pull/3173
- Include VM path in plugin version error by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3178
- [ci] Simplify ci monitoring with custom actions by @marun in https://github.com/ava-labs/avalanchego/pull/3161
- [vms/avm] Replace `strings.Replace` with `fmt.Sprintf` in tests by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/3177
- Changes to support teleporter e2e tests by @feuGeneA in https://github.com/ava-labs/avalanchego/pull/3179
- Reduce usage of `getBlock` in consensus by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3151
- [ci] Enable run-monitored-tmpnet-cmd reuse by other repos by @marun in https://github.com/ava-labs/avalanchego/pull/3186
- Restructured fee calculator API by @abi87 in https://github.com/ava-labs/avalanchego/pull/3145
- P-Chain: Block-level fee Calculator by @abi87 in https://github.com/ava-labs/avalanchego/pull/3032
- [ci] Allow antithesis test setups to be triggered independently by @marun in https://github.com/ava-labs/avalanchego/pull/3183
- [antithesis] Fix image version separator in triggering workflows by @marun in https://github.com/ava-labs/avalanchego/pull/3191
- Remove `block.Status` by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3158
- [antithesis] Refactor compose config generation to simplify reuse by @marun in https://github.com/ava-labs/avalanchego/pull/3184
- [antithesis] Add schedule for workflows by @marun in https://github.com/ava-labs/avalanchego/pull/3192
- Update `golangci-lint` to `v1.59.1` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/3195
- [ci] Ensure monitoring action compatibility for other repos by @marun in https://github.com/ava-labs/avalanchego/pull/3193
- chore: fix some comments for struct field by @linghuying in https://github.com/ava-labs/avalanchego/pull/3194
- [antithesis] Configure workload history by @marun in https://github.com/ava-labs/avalanchego/pull/3196
- [vms/proposervm] Set build block time correctly when anyone can propose by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/3197
- chore: fix comment by @polymaer in https://github.com/ava-labs/avalanchego/pull/3201
- Make math.Add64 and math.Mul64 generic by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3205
- Implement ACP-103 fee package by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3203
- [antithesis] Fix job duration by @marun in https://github.com/ava-labs/avalanchego/pull/3206
- [vms/platformvm] `RegisterDUnsignedTxsTypes` -> `RegisterDurangoUnsignedTxsTypes` by @dhrubabasu in https://github.com/ava-labs/avalanchego/pull/3212
- chore: fix some comments by @yingshanghuangqiao in https://github.com/ava-labs/avalanchego/pull/3213
- Fix typos by @omahs in https://github.com/ava-labs/avalanchego/pull/3208
- Cleanup fee.staticCalculator by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3210
- typo by @meaghanfitzgerald in https://github.com/ava-labs/avalanchego/pull/3220
- add getSubnet to p-chain api reference by @felipemadero in https://github.com/ava-labs/avalanchego/pull/3204
- [ci] Update fuzz workflows to target master branch by @marun in https://github.com/ava-labs/avalanchego/pull/3221
- Cleanup wallet tests by @StephenButtolph in https://github.com/ava-labs/avalanchego/pull/3230
- Update local validator start time by @ceyonur in https://github.com/ava-labs/avalanchego/pull/3224

### New Contributors

- @feuGeneA made their first contribution in https://github.com/ava-labs/avalanchego/pull/3179
- @linghuying made their first contribution in https://github.com/ava-labs/avalanchego/pull/3194
- @polymaer made their first contribution in https://github.com/ava-labs/avalanchego/pull/3201
- @yingshanghuangqiao made their first contribution in https://github.com/ava-labs/avalanchego/pull/3213
- @omahs made their first contribution in https://github.com/ava-labs/avalanchego/pull/3208

**Full Changelog**: https://github.com/ava-labs/avalanchego/compare/v1.11.9...v1.11.10

## [v1.11.9](https://github.com/ava-labs/avalanchego/releases/tag/v1.11.9)

This version is backwards compatible to [v1.11.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.11.0). It is optional, but encouraged.
Expand Down
11 changes: 0 additions & 11 deletions database/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ func GetID(db KeyValueReader, key []byte) (ids.ID, error) {
return ids.ToID(b)
}

func ParseID(b []byte) (ids.ID, error) {
return ids.ToID(b)
}

func PutUInt64(db KeyValueWriter, key []byte, val uint64) error {
b := PackUInt64(val)
return db.Put(key, b)
Expand Down Expand Up @@ -163,13 +159,6 @@ func Size(db Iteratee) (int, error) {
return size, iterator.Error()
}

func IsEmpty(db Iteratee) (bool, error) {
iterator := db.NewIterator()
defer iterator.Release()

return !iterator.Next(), iterator.Error()
}

func AtomicClear(readerDB Iteratee, deleterDB KeyValueDeleter) error {
return AtomicClearPrefix(readerDB, deleterDB, nil)
}
Expand Down
38 changes: 37 additions & 1 deletion genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"fmt"
"os"
"path/filepath"
"time"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils"
Expand All @@ -21,6 +22,8 @@ import (
"github.com/ava-labs/avalanchego/vms/platformvm/signer"
)

const localNetworkUpdateStartTimePeriod = 9 * 30 * 24 * time.Hour // 9 months

var (
_ utils.Sortable[Allocation] = Allocation{}

Expand Down Expand Up @@ -170,6 +173,10 @@ var (
// LocalConfig is the config that should be used to generate a local
// genesis.
LocalConfig Config

// unmodifiedLocalConfig is the LocalConfig before advancing the StartTime
// to a recent value.
unmodifiedLocalConfig Config
)

func init() {
Expand All @@ -196,10 +203,21 @@ func init() {
panic(err)
}

LocalConfig, err = unparsedLocalConfig.Parse()
unmodifiedLocalConfig, err = unparsedLocalConfig.Parse()
if err != nil {
panic(err)
}

// Renew the staking start time of the local config if required
definedStartTime := time.Unix(int64(unmodifiedLocalConfig.StartTime), 0)
recentStartTime := getRecentStartTime(
definedStartTime,
time.Now(),
localNetworkUpdateStartTimePeriod,
)

LocalConfig = unmodifiedLocalConfig
LocalConfig.StartTime = uint64(recentStartTime.Unix())
}

func GetConfig(networkID uint32) *Config {
Expand Down Expand Up @@ -247,3 +265,21 @@ func parseGenesisJSONBytesToConfig(bytes []byte) (*Config, error) {
}
return &config, nil
}

// getRecentStartTime advances [definedStartTime] in chunks of [period]. It
// returns the latest startTime that isn't after [now].
func getRecentStartTime(
definedStartTime time.Time,
now time.Time,
period time.Duration,
) time.Time {
startTime := definedStartTime
for {
nextStartTime := startTime.Add(period)
if now.Before(nextStartTime) {
break
}
startTime = nextStartTime
}
return startTime
}
Loading

0 comments on commit f3c96be

Please sign in to comment.