Skip to content

Commit

Permalink
Merge pull request #876 from iotaledger/develop
Browse files Browse the repository at this point in the history
Merge v0.3.3 changes into master
  • Loading branch information
capossele authored Dec 10, 2020
2 parents dfef9f5 + 9ab6a4a commit e197de7
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 51 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.3.3 - 2020-12-10
* Fix sync issue.
* Fix pkger issue.
* **Breaking**: bumps network and database versions

# v0.3.2 - 2020-12-09
* Switch from BadgerDB to Pebble.
* Add FPC statements.
Expand Down
3 changes: 1 addition & 2 deletions dapps/valuetransfers/packages/tangle/missingoutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/address"
"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/transaction"
"github.com/iotaledger/goshimmer/packages/clock"
"github.com/iotaledger/hive.go/marshalutil"
"github.com/iotaledger/hive.go/objectstorage"
)
Expand All @@ -25,7 +24,7 @@ type MissingOutput struct {
func NewMissingOutput(outputID transaction.OutputID) *MissingOutput {
return &MissingOutput{
outputID: outputID,
missingSince: clock.SyncedTime(),
missingSince: time.Now(),
}
}

Expand Down
3 changes: 1 addition & 2 deletions dapps/valuetransfers/packages/tangle/missingpayload.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/payload"
"github.com/iotaledger/goshimmer/packages/clock"
"github.com/iotaledger/hive.go/byteutils"
"github.com/iotaledger/hive.go/marshalutil"
"github.com/iotaledger/hive.go/objectstorage"
Expand All @@ -24,7 +23,7 @@ type MissingPayload struct {
func NewMissingPayload(payloadID payload.ID) *MissingPayload {
return &MissingPayload{
payloadID: payloadID,
missingSince: clock.SyncedTime(),
missingSince: time.Now(),
}
}

Expand Down
3 changes: 1 addition & 2 deletions packages/gossip/neighbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"sync"
"time"

"github.com/iotaledger/goshimmer/packages/clock"
"github.com/iotaledger/hive.go/autopeering/peer"
"github.com/iotaledger/hive.go/logger"
"github.com/iotaledger/hive.go/netutil"
Expand Down Expand Up @@ -56,7 +55,7 @@ func NewNeighbor(peer *peer.Peer, conn net.Conn, log *logger.Logger) *Neighbor {
log: log,
queue: make(chan []byte, neighborQueueSize),
closing: make(chan struct{}),
connectionEstablished: clock.SyncedTime(),
connectionEstablished: time.Now(),
}
}

Expand Down
3 changes: 1 addition & 2 deletions packages/gossip/server/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"time"

"github.com/iotaledger/goshimmer/packages/clock"
pb "github.com/iotaledger/goshimmer/packages/gossip/server/proto"
"github.com/iotaledger/hive.go/autopeering/server"
"google.golang.org/protobuf/proto"
Expand All @@ -24,7 +23,7 @@ func newHandshakeRequest(toAddr string) ([]byte, error) {
m := &pb.HandshakeRequest{
Version: versionNum,
To: toAddr,
Timestamp: clock.SyncedTime().Unix(),
Timestamp: time.Now().Unix(),
}
return proto.Marshal(m)
}
Expand Down
13 changes: 6 additions & 7 deletions packages/gossip/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"sync"
"time"

"github.com/iotaledger/goshimmer/packages/clock"
"github.com/iotaledger/hive.go/autopeering/peer"
"github.com/iotaledger/hive.go/autopeering/peer/service"
pb "github.com/iotaledger/hive.go/autopeering/server/proto"
Expand Down Expand Up @@ -215,7 +214,7 @@ func (t *TCP) run() {

// add a new matcher to the list
case m := <-t.addAcceptMatcher:
m.deadline = clock.SyncedTime().Add(connectionTimeout)
m.deadline = time.Now().Add(connectionTimeout)
matcherList.PushBack(m)

// on accept received, check all matchers for a fit
Expand All @@ -238,7 +237,7 @@ func (t *TCP) run() {

// on timeout, check for expired matchers
case <-timeout.C:
now := clock.SyncedTime()
now := time.Now()

// notify and remove any expired matchers
for e := matcherList.Front(); e != nil; e = e.Next() {
Expand Down Expand Up @@ -330,7 +329,7 @@ func (t *TCP) doHandshake(key ed25519.PublicKey, remoteAddr string, conn net.Con
return fmt.Errorf("handshake size too large: %d, max %d", l, maxHandshakePacketSize)
}

err = conn.SetWriteDeadline(clock.SyncedTime().Add(handshakeTimeout))
err = conn.SetWriteDeadline(time.Now().Add(handshakeTimeout))
if err != nil {
return err
}
Expand All @@ -339,7 +338,7 @@ func (t *TCP) doHandshake(key ed25519.PublicKey, remoteAddr string, conn net.Con
return err
}

err = conn.SetReadDeadline(clock.SyncedTime().Add(handshakeTimeout))
err = conn.SetReadDeadline(time.Now().Add(handshakeTimeout))
if err != nil {
return err
}
Expand Down Expand Up @@ -367,7 +366,7 @@ func (t *TCP) doHandshake(key ed25519.PublicKey, remoteAddr string, conn net.Con
}

func (t *TCP) readHandshakeRequest(conn net.Conn) (ed25519.PublicKey, []byte, error) {
if err := conn.SetReadDeadline(clock.SyncedTime().Add(handshakeTimeout)); err != nil {
if err := conn.SetReadDeadline(time.Now().Add(handshakeTimeout)); err != nil {
return ed25519.PublicKey{}, nil, err
}
b := make([]byte, maxHandshakePacketSize)
Expand Down Expand Up @@ -413,7 +412,7 @@ func (t *TCP) writeHandshakeResponse(reqData []byte, conn net.Conn) error {
return fmt.Errorf("handshake size too large: %d, max %d", l, maxHandshakePacketSize)
}

err = conn.SetWriteDeadline(clock.SyncedTime().Add(handshakeTimeout))
err = conn.SetWriteDeadline(time.Now().Add(handshakeTimeout))
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions packages/tangle/missingmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"time"

"github.com/iotaledger/goshimmer/packages/clock"
"github.com/iotaledger/hive.go/byteutils"
"github.com/iotaledger/hive.go/marshalutil"
"github.com/iotaledger/hive.go/objectstorage"
Expand All @@ -22,7 +21,7 @@ type MissingMessage struct {
func NewMissingMessage(messageID MessageID) *MissingMessage {
return &MissingMessage{
messageID: messageID,
missingSince: clock.SyncedTime(),
missingSince: time.Now(),
}
}

Expand Down
7 changes: 5 additions & 2 deletions packages/tangle/tangle.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,14 @@ func (t *Tangle) isMessageSolid(msg *Message, msgMetadata *MessageMetadata) bool
return true
}

// as missing messages are requested in isMessageMarkedAsSolid, we want to prevent short-circuit evaluation
solid := true

msg.ForEachParent(func(parent Parent) {
solid = solid && t.isMessageMarkedAsSolid(parent.ID)
// as missing messages are requested in isMessageMarkedAsSolid,
// we want to prevent short-circuit evaluation, thus we need to use a tmp variable
// to avoid side effects from comparing directly to the function call.
tmp := t.isMessageMarkedAsSolid(parent.ID)
solid = solid && tmp
})

return solid
Expand Down
12 changes: 12 additions & 0 deletions pkged.go

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions plugins/analysis/dashboard/pkged.go

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/autopeering/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ const (

func init() {
flag.StringSlice(CfgEntryNodes, []string{"[email protected]:15626", "5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entrynode.alphanet.tanglebay.org:14656"}, "list of trusted entry nodes for auto peering")
flag.Int(CfgNetworkVersion, 10, "autopeering network version")
flag.Int(CfgNetworkVersion, 11, "autopeering network version")
}
2 changes: 1 addition & 1 deletion plugins/banner/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
once sync.Once

// AppVersion version number
AppVersion = "v0.3.2"
AppVersion = "v0.3.3"
// SimplifiedAppVersion is the version number without commit hash
SimplifiedAppVersion = simplifiedVersion(AppVersion)
)
Expand Down
7 changes: 3 additions & 4 deletions plugins/dashboard/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ We are using [pkger](https://github.com/markbates/pkger) to wrap all built front

1. [Install `pkger`](https://github.com/markbates/pkger#installation) if not already done.
2. Build Dashboard by running `yarn build` within the `frontend` directory.
3. Change to the `plugins/dashboard` directory.
4. Run `pkger -o /plugins/dashboard`.
5. `plugins/dashboard/pkged.go` should have been modified.
6. Done. Now you can build goShimmer and your Dashboard changes will be included within the binary.
3. Run `pkger`.
4. `pkged.go` under root directory of goShimmer should have been modified.
5. Done. Now you can build goShimmer and your Dashboard changes will be included within the binary.
12 changes: 0 additions & 12 deletions plugins/dashboard/pkged.go

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/database/versioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
const (
// DBVersion defines the version of the database schema this version of GoShimmer supports.
// Every time there's a breaking change regarding the stored data, this version flag should be adjusted.
DBVersion = 12
DBVersion = 13
)

var (
Expand Down
2 changes: 1 addition & 1 deletion tools/docker-network/builder/docker-compose.builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
container_name: builder
image: golang:1.15.5
working_dir: /tmp/goshimmer/
entrypoint: go install main.go
entrypoint: go install main.go pkged.go
volumes:
- ../../..:/tmp/goshimmer:ro
- goshimmer-cache:/go
Expand Down

0 comments on commit e197de7

Please sign in to comment.