Skip to content

Commit

Permalink
Merge pull request ava-labs#127 from ava-labs/bump-avago-1.9.4
Browse files Browse the repository at this point in the history
bump to avago 1.9.4
  • Loading branch information
felipemadero authored Dec 8, 2022
2 parents c428e54 + db97d18 commit ad2ea38
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 19 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: scripts/tests.integration.sh
- name: Run e2e tests
shell: bash
run: E2E=true scripts/run.sh 1.9.3
run: E2E=true scripts/run.sh 1.9.4
env:
E2E: true
build_test_release:
Expand All @@ -45,7 +45,9 @@ jobs:
with:
go-version: 1.18
- name: Set up arm64 cross compiler
run: sudo apt-get -y install gcc-aarch64-linux-gnu
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Checkout osxcross
uses: actions/checkout@v2
with:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ this to its logical conclusion).
[v0.0.10] [email protected]
[v0.0.11] [email protected]
[v0.0.12] [email protected]
[v0.0.13] [email protected]
```

## Introduction
Expand Down
3 changes: 2 additions & 1 deletion chain/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ package chain

import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/set"
)

type Mempool interface {
Len() int
Prune(ids.Set)
Prune(set.Set[ids.ID])
PopMax() (*Transaction, uint64)
Add(*Transaction) bool
NewTxs(uint64) []*Transaction
Expand Down
3 changes: 2 additions & 1 deletion chain/mempool_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions chain/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/ava-labs/avalanchego/database/memdb"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ethereum/go-ethereum/crypto"
)

Expand All @@ -23,7 +24,7 @@ func TestTransaction(t *testing.T) {
t.Fatal(err)
}

found := ids.NewSet(3)
found := set.NewSet[ids.ID](3)
g := DefaultGenesis()
for i := range []int{0, 1, 2} {
tx := &Transaction{
Expand Down Expand Up @@ -80,7 +81,7 @@ func TestTransactionErrInvalidSignature(t *testing.T) {
return createTestTx(t, ids.ID{0, 1}, priv)
},
blockTime: 1,
ctx: &Context{RecentBlockIDs: ids.Set{{0, 1}: struct{}{}}},
ctx: &Context{RecentBlockIDs: set.Set[ids.ID]{{0, 1}: struct{}{}}},
executeErr: nil,
},
{
Expand All @@ -89,7 +90,7 @@ func TestTransactionErrInvalidSignature(t *testing.T) {
return tx
},
blockTime: 1,
ctx: &Context{RecentBlockIDs: ids.Set{{0, 1}: struct{}{}}},
ctx: &Context{RecentBlockIDs: set.Set[ids.ID]{{0, 1}: struct{}{}}},
executeErr: ErrInvalidBalance,
},
}
Expand Down
5 changes: 3 additions & 2 deletions chain/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ package chain
import (
"github.com/ava-labs/avalanchego/database"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/set"
)

type Context struct {
RecentBlockIDs ids.Set
RecentTxIDs ids.Set
RecentBlockIDs set.Set[ids.ID]
RecentTxIDs set.Set[ids.ID]
RecentLoadUnits uint64

Prices []uint64
Expand Down
1 change: 1 addition & 0 deletions compatibility.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"rpcChainVMProtocolVersion": {
"v0.0.13": 20,
"v0.0.12": 19,
"v0.0.11": 19,
"v0.0.10": 19,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/ava-labs/avalanche-network-runner-sdk v0.3.0
github.com/ava-labs/avalanchego v1.9.3
github.com/ava-labs/avalanchego v1.9.4
github.com/ethereum/go-ethereum v1.10.26
github.com/fatih/color v1.13.0
github.com/golang/mock v1.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ github.com/ava-labs/avalanche-network-runner-sdk v0.3.0 h1:TVi9JEdKNU/RevYZ9PyW4
github.com/ava-labs/avalanche-network-runner-sdk v0.3.0/go.mod h1:SgKJvtqvgo/Bl/c8fxEHCLaSxEbzimYfBopcfrajxQk=
github.com/ava-labs/avalanchego v1.9.3 h1:vEIa5R7p9P+q1Tf4DHFQppI0ELgKdv0tLVx4sMDNXZc=
github.com/ava-labs/avalanchego v1.9.3/go.mod h1:UR0FdZiS5+0fEqGk3S8zLIiQ2xdzIfTcCnndBRJQ5NA=
github.com/ava-labs/avalanchego v1.9.4 h1:z5tE/vUGzUQflqv3mn6X5E1VTCZHYhuD36idOyPNRrc=
github.com/ava-labs/avalanchego v1.9.4/go.mod h1:H4pMTYzgudfPs9WX+KXI0nCiUGNkdgPWOwm1nqzGibQ=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
Expand Down
3 changes: 2 additions & 1 deletion mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"sync"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/set"

"github.com/ava-labs/spacesvm/chain"
)
Expand Down Expand Up @@ -132,7 +133,7 @@ func (th *Mempool) Remove(id ids.ID) *chain.Transaction { // O(log N)
}

// Prune removes all transactions that are not found in "validHashes".
func (th *Mempool) Prune(validHashes ids.Set) {
func (th *Mempool) Prune(validHashes set.Set[ids.ID]) {
th.mu.RLock()
toRemove := []ids.ID{}
for _, txE := range th.maxHeap.items { // O(N)
Expand Down
5 changes: 3 additions & 2 deletions mempool/mempool_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ethereum/go-ethereum/crypto"

"github.com/ava-labs/spacesvm/chain"
Expand Down Expand Up @@ -45,7 +46,7 @@ func createTestMempool(
maxSize int,
n int,
sampleBlk int,
) (mp chain.Mempool, sampleBlkIDs ids.Set) {
) (mp chain.Mempool, sampleBlkIDs set.Set[ids.ID]) {
b.Helper()
if sampleBlk*2 >= n {
b.Fatalf("unexpected sampleBlk %d (expected < N/2 %d)", sampleBlk, n)
Expand Down Expand Up @@ -91,7 +92,7 @@ func createTestMempool(
txs[i] = tx
}

sampleBlkIDs = ids.NewSet(sampleBlk)
sampleBlkIDs = set.NewSet[ids.ID](sampleBlk)

mp = mempool.New(g, maxSize)

Expand Down
2 changes: 1 addition & 1 deletion scripts/mock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

echo "MOCKGEN RUNNING!"

go install -v github.com/golang/mock/mockgen@v1.6.0
go install -v github.com/golang/mock/mockgen@v1.7.0-rc.1

mockgen \
-copyright_file=./LICENSE.header \
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/snow/choices"
"github.com/ava-labs/avalanchego/snow/engine/common"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/avalanchego/utils/units"
avago_version "github.com/ava-labs/avalanchego/version"
ecommon "github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -786,15 +787,15 @@ func (app *appSender) SendAppGossip(ctx context.Context, appGossipBytes []byte)
return app.instances[app.next].vm.AppGossip(ctx, sender, appGossipBytes)
}

func (app *appSender) SendAppRequest(_ context.Context, _ ids.NodeIDSet, _ uint32, _ []byte) error {
func (app *appSender) SendAppRequest(_ context.Context, _ set.Set[ids.NodeID], _ uint32, _ []byte) error {
return nil
}

func (app *appSender) SendAppResponse(_ context.Context, _ ids.NodeID, _ uint32, _ []byte) error {
return nil
}

func (app *appSender) SendAppGossipSpecific(_ context.Context, _ ids.NodeIDSet, _ []byte) error {
func (app *appSender) SendAppGossipSpecific(_ context.Context, _ set.Set[ids.NodeID], _ []byte) error {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import "github.com/ava-labs/avalanchego/version"
var Version = &version.Semantic{
Major: 0,
Minor: 0,
Patch: 12,
Patch: 13,
}
5 changes: 3 additions & 2 deletions vm/chain_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package vm
import (
"github.com/ava-labs/avalanchego/database"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/set"
log "github.com/inconshreveable/log15"

"github.com/ava-labs/spacesvm/chain"
Expand Down Expand Up @@ -67,8 +68,8 @@ func (vm *VM) Accepted(b *chain.StatelessBlock) {

func (vm *VM) ExecutionContext(currTime int64, lastBlock *chain.StatelessBlock) (*chain.Context, error) {
g := vm.genesis
recentBlockIDs := ids.Set{}
recentTxIDs := ids.Set{}
recentBlockIDs := set.Set[ids.ID]{}
recentTxIDs := set.Set[ids.ID]{}
recentUnits := uint64(0)
prices := []uint64{}
costs := []uint64{}
Expand Down

0 comments on commit ad2ea38

Please sign in to comment.