Skip to content

Commit

Permalink
Merge pull request #2086 from iotaledger/develop
Browse files Browse the repository at this point in the history
v0.8.8
  • Loading branch information
karimodm authored Mar 1, 2022
2 parents 3329509 + a4c427d commit 54b663f
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 35 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# v0.8.8 - 2022-03-01

> This release introduces a major bug fix that could prevent nodes from running out of sync.
The snapshot has been taken at 2022-02-26 19:30 CET.
- Remove booker & issuance locks (#2084)
- Build(deps): bump url-parse from 1.5.7 to 1.5.10 in /plugins/dashboard/frontend (#2081)
- Add issuerID to remote metrics (#2042)

# v0.8.7 - 2022-02-24

> This release introduces several small bug fixes and improvements.
Expand Down
3 changes: 3 additions & 0 deletions packages/remotemetrics/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type SyncStatusChangedEvent struct {
type MessageFinalizedMetrics struct {
Type string `json:"type" bson:"type"`
NodeID string `json:"nodeID" bson:"nodeID"`
IssuerID string `json:"issuerID" bson:"issuerID"`
MetricsLevel uint8 `json:"metricsLevel" bson:"metricsLevel"`
MessageID string `json:"messageID" bson:"messageID"`
TransactionID string `json:"transactionID,omitempty" bson:"transactionID"`
Expand All @@ -67,6 +68,7 @@ type MessageFinalizedMetrics struct {
type MessageScheduledMetrics struct {
Type string `json:"type" bson:"type"`
NodeID string `json:"nodeID" bson:"nodeID"`
IssuerID string `json:"issuerID" bson:"issuerID"`
MetricsLevel uint8 `json:"metricsLevel" bson:"metricsLevel"`
MessageID string `json:"messageID" bson:"messageID"`
TransactionID string `json:"transactionID,omitempty" bson:"transactionID"`
Expand Down Expand Up @@ -111,6 +113,7 @@ type MissingMessageMetrics struct {
type BranchConfirmationMetrics struct {
Type string `json:"type" bson:"type"`
NodeID string `json:"nodeID" bson:"nodeID"`
IssuerID string `json:"issuerID" bson:"issuerID"`
MetricsLevel uint8 `json:"metricsLevel" bson:"metricsLevel"`
MessageID string `json:"messageID" bson:"messageID"`
BranchID string `json:"transactionID" bson:"transactionID"`
Expand Down
5 changes: 0 additions & 5 deletions packages/tangle/booker.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ type Booker struct {
bookerQueue chan MessageID
shutdown chan struct{}
shutdownWG sync.WaitGroup

sync.RWMutex
}

// NewBooker is the constructor of a Booker.
Expand Down Expand Up @@ -157,9 +155,6 @@ func (b *Booker) Shutdown() {
// as booked. Following, the message branch is set, and it can continue in the dataflow to add support to the determined
// branches and markers.
func (b *Booker) BookMessage(messageID MessageID) (err error) {
b.RLock()
defer b.RUnlock()

b.tangle.Storage.Message(messageID).Consume(func(message *Message) {
b.tangle.Storage.MessageMetadata(messageID).Consume(func(messageMetadata *MessageMetadata) {
// TODO: we need to enforce that the dislike references contain "the other" branch with respect to the strong references
Expand Down
15 changes: 2 additions & 13 deletions packages/tangle/messagefactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ type MessageFactory struct {

powTimeout time.Duration

worker Worker
workerMutex sync.RWMutex
issuanceMutex sync.Mutex
worker Worker
workerMutex sync.RWMutex
}

// NewMessageFactory creates a new message factory.
Expand Down Expand Up @@ -76,23 +75,17 @@ func (f *MessageFactory) SetTimeout(timeout time.Duration) {
// It also triggers the MessageConstructed event once it's done, which is for example used by the plugins to listen for
// messages that shall be attached to the tangle.
func (f *MessageFactory) IssuePayload(p payload.Payload, parentsCount ...int) (*Message, error) {
f.tangle.Booker.Lock()
defer f.tangle.Booker.Unlock()

payloadLen := len(p.Bytes())
if payloadLen > payload.MaxSize {
err := fmt.Errorf("maximum payload size of %d bytes exceeded", payloadLen)
f.Events.Error.Trigger(err)
return nil, err
}

f.issuanceMutex.Lock()

sequenceNumber, err := f.sequence.Next()
if err != nil {
err = errors.Errorf("could not create sequence number: %w", err)
f.Events.Error.Trigger(err)
f.issuanceMutex.Unlock()
return nil, err
}

Expand All @@ -116,7 +109,6 @@ func (f *MessageFactory) IssuePayload(p payload.Payload, parentsCount ...int) (*
if parents, err = f.tips(p, countParents); err != nil {
err = errors.Errorf("tips could not be selected: %w", err)
f.Events.Error.Trigger(err)
f.issuanceMutex.Unlock()
return nil, err
}
}
Expand All @@ -126,7 +118,6 @@ func (f *MessageFactory) IssuePayload(p payload.Payload, parentsCount ...int) (*
if err != nil {
err = errors.Errorf("like references could not be prepared: %w", err)
f.Events.Error.Trigger(err)
f.issuanceMutex.Unlock()
return nil, err
}
nonce, errPoW = f.doPOW(references, issuingTime, issuerPublicKey, sequenceNumber, p)
Expand All @@ -135,10 +126,8 @@ func (f *MessageFactory) IssuePayload(p payload.Payload, parentsCount ...int) (*
if errPoW != nil {
err = errors.Errorf("pow failed: %w", errPoW)
f.Events.Error.Trigger(err)
f.issuanceMutex.Unlock()
return nil, err
}
f.issuanceMutex.Unlock()

// create the signature
signature, err := f.sign(references, issuingTime, issuerPublicKey, sequenceNumber, p, nonce)
Expand Down
2 changes: 0 additions & 2 deletions packages/tangle/tangle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,6 @@ func (f *MessageFactory) issueInvalidTsPayload(p payload.Payload, _ ...*Tangle)
return nil, err
}

f.issuanceMutex.Lock()
defer f.issuanceMutex.Unlock()
sequenceNumber, err := f.sequence.Next()
if err != nil {
err = fmt.Errorf("could not create sequence number: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion pkged.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions plugins/analysis/dashboard/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6165,9 +6165,9 @@ url-loader@^4.1.0:
schema-utils "^2.6.5"

url-parse@^1.4.3:
version "1.5.7"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.7.tgz#00780f60dbdae90181f51ed85fb24109422c932a"
integrity sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA==
version "1.5.10"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion plugins/autopeering/discovery/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/iotaledger/hive.go/configuration"
// ParametersDefinitionDiscovery contains the definition of configuration parameters used by the autopeering peer discovery.
type ParametersDefinitionDiscovery struct {
// NetworkVersion defines the config flag of the network version.
NetworkVersion uint32 `default:"48" usage:"autopeering network version"`
NetworkVersion uint32 `default:"49" usage:"autopeering network version"`

// EntryNodes defines the config flag of the entry nodes.
EntryNodes []string `default:"2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@analysisentry-01.devnet.shimmer.iota.cafe:15626,5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entry-0.devnet.tanglebay.com:14646,CAB87iQZR6BjBrCgEBupQJ4gpEBgvGKKv3uuGVRBKb4n@entry-1.devnet.tanglebay.com:14646" usage:"list of trusted entry nodes for auto peering"`
Expand Down
2 changes: 1 addition & 1 deletion plugins/banner/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var (
Plugin = node.NewPlugin(PluginName, nil, node.Enabled, configure, run)

// AppVersion version number
AppVersion = "v0.8.7"
AppVersion = "v0.8.8"
// SimplifiedAppVersion is the version number without commit hash
SimplifiedAppVersion = simplifiedVersion(AppVersion)
)
Expand Down
6 changes: 3 additions & 3 deletions plugins/dagsvisualizer/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13039,9 +13039,9 @@ [email protected]:
schema-utils "^3.0.0"

url-parse@^1.4.3, url-parse@^1.5.3:
version "1.5.7"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.7.tgz#00780f60dbdae90181f51ed85fb24109422c932a"
integrity sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA==
version "1.5.10"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"
Expand Down
6 changes: 3 additions & 3 deletions plugins/dashboard/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7149,9 +7149,9 @@ url-loader@^1.1.2:
schema-utils "^1.0.0"

url-parse@^1.4.3:
version "1.5.7"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.7.tgz#00780f60dbdae90181f51ed85fb24109422c932a"
integrity sha512-HxWkieX+STA38EDk7CE9MEryFeHCKzgagxlGvsdS7WBImq9Mk+PGwiT56w82WI3aicwJA8REp42Cxo98c8FZMA==
version "1.5.10"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion plugins/database/versioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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 = 50
DBVersion = 51
)

var (
Expand Down
2 changes: 1 addition & 1 deletion plugins/remotelog/server/.env.default
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ELK_VERSION=7.5.2
ELK_VERSION=7.13.2
VIRTUAL_HOST=
LETSENCRYPT_HOST=
6 changes: 5 additions & 1 deletion plugins/remotemetrics/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"sync"
"time"

"github.com/iotaledger/hive.go/identity"
"github.com/iotaledger/hive.go/types"
"go.uber.org/atomic"

Expand Down Expand Up @@ -66,7 +67,10 @@ func onBranchConfirmed(branchID ledgerstate.BranchID) {
ConfirmedTimestamp: clock.SyncedTime(),
DeltaConfirmed: clock.Since(oldestAttachmentTime).Nanoseconds(),
}

deps.Tangle.Storage.Message(oldestAttachmentMessageID).Consume(func(message *tangle.Message) {
issuerID := identity.NewID(message.IssuerPublicKey())
record.IssuerID = issuerID.String()
})
_ = deps.RemoteLogger.Send(record)
sendBranchMetrics()
}
Expand Down
3 changes: 3 additions & 0 deletions plugins/remotemetrics/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func sendMessageSchedulerRecord(messageID tangle.MessageID, recordType string) {
deps.Tangle.Storage.Message(messageID).Consume(func(message *tangle.Message) {
issuerID := identity.NewID(message.IssuerPublicKey())
record.IssuedTimestamp = message.IssuingTime()
record.IssuerID = issuerID.String()
record.AccessMana = deps.Tangle.Scheduler.GetManaFromCache(issuerID)
record.StrongEdgeCount = len(message.ParentsByType(tangle.StrongParentType))
if weakParentsCount := len(message.ParentsByType(tangle.WeakParentType)); weakParentsCount > 0 {
Expand Down Expand Up @@ -120,7 +121,9 @@ func onMessageFinalized(messageID tangle.MessageID) {
}

deps.Tangle.Storage.Message(messageID).Consume(func(message *tangle.Message) {
issuerID := identity.NewID(message.IssuerPublicKey())
record.IssuedTimestamp = message.IssuingTime()
record.IssuerID = issuerID.String()
record.StrongEdgeCount = len(message.ParentsByType(tangle.StrongParentType))
if weakParentsCount := len(message.ParentsByType(tangle.WeakParentType)); weakParentsCount > 0 {
record.WeakEdgeCount = weakParentsCount
Expand Down

0 comments on commit 54b663f

Please sign in to comment.