Skip to content

Commit

Permalink
Merge pull request #718 from iotaledger/develop
Browse files Browse the repository at this point in the history
Merge v0.2.4 changes into master
  • Loading branch information
Wollac authored Sep 3, 2020
2 parents d9115cb + ea0d2be commit 3247767
Show file tree
Hide file tree
Showing 42 changed files with 1,494 additions and 286 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:latest
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:latest
docker pull gaiadocker/iproute2:latest
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:

- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:latest
docker pull angelocapossele/drand:1.1.1
docker pull gaiaadm/pumba:latest
docker pull gaiadocker/iproute2:latest
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# v0.2.4 - 2020-09-03
* Fixes race condition that was preventing the deletion of some entries from missing messages.
* Improves the Tangle-BadgerDB interaction.
* Improved APIs for debug with the addition of the value-tips endpoint.
* Improved autopeering management by adding the ability to specify a given network version.
* Integrates initial support for the dRNG module.
* **Breaking**: bumps network and database versions

# v0.2.3 - 2020-08-11
* Fixes synchronization issue where missing messages were not requested more than once
* Fixes node's dashboard explorer crashing or not properly visualizing the payload of a given message
* Improves Grafana local dashboard:
* Adds support for the sync-beacon payload type
* Displaying uptime and nodeID
* Fixed all linter issues to improve code quality
* **Breaking**: bumps network and database versions

# v0.2.2 - 2020-07-27
* Improves message and transaction validation:
Expand Down
48 changes: 43 additions & 5 deletions client/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@ import (
"errors"
"net/http"

webapi_tools "github.com/iotaledger/goshimmer/plugins/webapi/tools"
webapi_missing "github.com/iotaledger/goshimmer/plugins/webapi/tools/message/missing"
webapi_pastcone "github.com/iotaledger/goshimmer/plugins/webapi/tools/message/pastcone"
webapi_value_objects "github.com/iotaledger/goshimmer/plugins/webapi/tools/value/objects"
webapi_value_tips "github.com/iotaledger/goshimmer/plugins/webapi/tools/value/tips"
)

const (
routePastCone = "tools/pastcone"
routePastCone = "tools/message/pastcone"
routeMissing = "tools/message/missing"

routeValueTips = "tools/value/tips"
routeValueDebug = "tools/value/objects"
)

// ------------------- Communication layer -----------------------------

// PastConeExist checks that all of the messages in the past cone of a message are existing on the node
// down to the genesis. Returns the number of messages in the past cone as well.
func (api *GoShimmerAPI) PastConeExist(base58EncodedMessageID string) (*webapi_tools.PastConeResponse, error) {
res := &webapi_tools.PastConeResponse{}
func (api *GoShimmerAPI) PastConeExist(base58EncodedMessageID string) (*webapi_pastcone.Response, error) {
res := &webapi_pastcone.Response{}

if err := api.do(
http.MethodGet,
routePastCone,
&webapi_tools.PastConeRequest{ID: base58EncodedMessageID},
&webapi_pastcone.Request{ID: base58EncodedMessageID},
res,
); err != nil {
return nil, err
Expand All @@ -30,3 +39,32 @@ func (api *GoShimmerAPI) PastConeExist(base58EncodedMessageID string) (*webapi_t
}
return res, nil
}

// Missing returns all the missing messages and their count.
func (api *GoShimmerAPI) Missing() (*webapi_missing.Response, error) {
res := &webapi_missing.Response{}
if err := api.do(http.MethodGet, routeMissing, nil, res); err != nil {
return nil, err
}
return res, nil
}

// ------------------- Value layer -----------------------------

// ValueTips returns the value objects info from the tips.
func (api *GoShimmerAPI) ValueTips() (*webapi_value_tips.Response, error) {
res := &webapi_value_tips.Response{}
if err := api.do(http.MethodGet, routeValueTips, nil, res); err != nil {
return nil, err
}
return res, nil
}

// ValueObjects returns the list of value objects.
func (api *GoShimmerAPI) ValueObjects() (*webapi_value_objects.Response, error) {
res := &webapi_value_objects.Response{}
if err := api.do(http.MethodGet, routeValueDebug, nil, res); err != nil {
return nil, err
}
return res, nil
}
6 changes: 3 additions & 3 deletions client/wallet/addressmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (addressManager *AddressManager) MarkAddressSpent(addressIndex uint64) {
sliceIndex, bitIndex := addressManager.spentAddressIndexes(addressIndex)

// mark address as spent
addressManager.spentAddresses[sliceIndex] = addressManager.spentAddresses[sliceIndex].SetFlag(uint(bitIndex))
addressManager.spentAddresses[sliceIndex] = addressManager.spentAddresses[sliceIndex].SetBit(uint(bitIndex))

// update spent address indexes
if addressIndex == addressManager.firstUnspentAddressIndex {
Expand All @@ -113,7 +113,7 @@ func (addressManager *AddressManager) MarkAddressSpent(addressIndex uint64) {
func (addressManager *AddressManager) IsAddressSpent(addressIndex uint64) bool {
sliceIndex, bitIndex := addressManager.spentAddressIndexes(addressIndex)

return addressManager.spentAddresses[sliceIndex].HasFlag(uint(bitIndex))
return addressManager.spentAddresses[sliceIndex].HasBit(uint(bitIndex))
}

// spentAddressIndexes retrieves the indexes for the internal representation of the spend addresses bitmask slice that
Expand All @@ -136,7 +136,7 @@ func (addressManager *AddressManager) spentAddressIndexes(addressIndex uint64) (
}

// update lastUnspentAddressIndex if necessary
if addressIndex > addressManager.lastUnspentAddressIndex && !addressManager.spentAddresses[sliceIndex].HasFlag(uint(bitIndex)) {
if addressIndex > addressManager.lastUnspentAddressIndex && !addressManager.spentAddresses[sliceIndex].HasBit(uint(bitIndex)) {
addressManager.lastUnspentAddressIndex = addressIndex
}

Expand Down
9 changes: 9 additions & 0 deletions dapps/valuetransfers/packages/tipmanager/tipmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ func (t *TipManager) Tips() (parent1ObjectID, parent2ObjectID payload.ID) {
return
}

// AllTips returns all the tips.
func (t *TipManager) AllTips() (tips []payload.ID) {
tips = make([]payload.ID, t.Size())
for i, tip := range t.tips.Keys() {
tips[i] = tip.(payload.ID)
}
return
}

// Size returns the total liked tips.
func (t *TipManager) Size() int {
return t.tips.Size()
Expand Down
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ require (
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/dgraph-io/badger/v2 v2.0.3
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/drand/drand v0.8.1
github.com/drand/kyber v1.0.1-0.20200331114745-30e90cc60f99
github.com/drand/drand v1.1.1
github.com/drand/kyber v1.1.2
github.com/gin-gonic/gin v1.6.3
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gobuffalo/packr/v2 v2.8.0
github.com/golang/protobuf v1.4.2
github.com/gorilla/websocket v1.4.2
github.com/iotaledger/hive.go v0.0.0-20200810103552-94bbf59c54fa
github.com/iotaledger/hive.go v0.0.0-20200824153656-adfc839cc240
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0
github.com/magiconair/properties v1.8.1
github.com/mr-tron/base58 v1.2.0
github.com/panjf2000/ants/v2 v2.4.1
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.0
github.com/shirou/gopsutil v2.20.5+incompatible
github.com/spf13/pflag v1.0.5
Expand All @@ -31,10 +31,8 @@ require (
go.uber.org/atomic v1.6.0
go.uber.org/zap v1.15.0
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 // indirect
golang.org/x/tools v0.0.0-20200330040139-fa3cc9eebcfe // indirect
google.golang.org/grpc v1.30.0
google.golang.org/grpc/examples v0.0.0-20200617041141-9a465503579e // indirect
google.golang.org/protobuf v1.25.0
gopkg.in/src-d/go-git.v4 v4.13.1
)
Loading

0 comments on commit 3247767

Please sign in to comment.