Skip to content

Commit

Permalink
Merge pull request #2348 from iotaledger/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
karimodm authored Jul 19, 2022
2 parents e8d192b + aeabb25 commit af7437a
Show file tree
Hide file tree
Showing 70 changed files with 1,496 additions and 1,026 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# v0.9.3 - 2022-07-19

> This release introduces bugfixes and improvements found in the previous release.
The snapshot has been changed and thus the ledger state is fully reset.

- Fix remote log collection (#2343)
- Fix marker walk during tip fishing (#2346)
- Fix: P2P protocol initialization (#2340)
- Update default TSC threshold (#2342)
- Improve tangle time used to calculate active cMana nodes. (#2338)
- Fix: do not trigger BlockRateLimiter if not bootstrapped (#2341)
- Notarization: do not care if attachment is booked when dealing with conflict events (#2336)
- Introduce by epoch index localized BlockID (#2331)
- Update docker-compose params (#2335)
- Support additional protocols on top of P2P connection (#2330)

# v0.9.2 - 2022-07-14

> This release introduces the epoch commitments feature which allows creating proofs-of-inclusion of a block in the tangle. This feature is also the first step to the development of pruning, local snapshots and will allow more efficient way of syncing a node. This release also improves the parameters of rate-setter that should improve user-experience of issuing new blocks. It also contains various bugfixes and improvements, change of terminology e.g. message -> block etc. as well as replacement of grades of finality with confirmation state.
Expand Down
5 changes: 1 addition & 4 deletions config.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"directory": "mainnetdb",
"inMemory": false
},
"gossip": {
"p2p": {
"bindAddress": "0.0.0.0:14666"
},
"logger": {
Expand Down Expand Up @@ -93,8 +93,5 @@
},
"networkdelay": {
"originPublicKey": "9DB3j9cWYSuEEtkvanrzqkzCQMdH1FGv3TawJdVbDxkd"
},
"manaInitializer": {
"FaucetAPI": "faucet-01.devnet.shimmer.iota.cafe:8080"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
- ANALYSIS_CLIENT_SERVERADDRESS={{ analysisServerHost }}:21888
- AUTOPEERING_BINDADDRESS=0.0.0.0:14626
- DASHBOARD_BINDADDRESS=0.0.0.0:8081
- GOSSIP_BINDADDRESS=0.0.0.0:14666
- P2P_BINDADDRESS=0.0.0.0:14666
- WEBAPI_BINDADDRESS=0.0.0.0:8080
- PROFILING_BINDADDRESS=0.0.0.0:6061
command: >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
- ANALYSIS_CLIENT_SERVERADDRESS={{ analysisServerHost }}:21888
- AUTOPEERING_BINDADDRESS=0.0.0.0:14626
- DASHBOARD_BINDADDRESS=0.0.0.0:8081
- GOSSIP_BINDADDRESS=0.0.0.0:14666
- P2P_BINDADDRESS=0.0.0.0:14666
- WEBAPI_BINDADDRESS=0.0.0.0:8080
- PROFILING_BINDADDRESS=0.0.0.0:6061
command: >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ filter {
}

json {
source => "block"
source => "message"
target => "log"
remove_field => ["block"]
remove_field => ["message"]
}
}

Expand Down Expand Up @@ -113,6 +113,15 @@ output {
ilm_pattern => "000001"
ilm_policy => "logstash-policy"
}
} else if [log][type] == "log" {
elasticsearch {
hosts => "elasticsearch:9200"
user => "{{ elkElasticUser }}"
password => "{{ elkElasticPassword }}"
ilm_rollover_alias => "logs"
ilm_pattern => "000001"
ilm_policy => "logstash-policy"
}
} else{
elasticsearch {
hosts => "elasticsearch:9200"
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
- ANALYSIS_CLIENT_SERVERADDRESS=analysisentry-01.devnet.shimmer.iota.cafe:21888
- AUTOPEERING_BINDADDRESS=0.0.0.0:14626
- DASHBOARD_BINDADDRESS=0.0.0.0:8081
- GOSSIP_BINDADDRESS=0.0.0.0:14666
- P2P_BINDADDRESS=0.0.0.0:14666
- WEBAPI_BINDADDRESS=0.0.0.0:8080
- PROFILING_BINDADDRESS=0.0.0.0:6061
- NETWORKDELAY_ORIGINPUBLICKEY=9DB3j9cWYSuEEtkvanrzqkzCQMdH1FGv3TawJdVbDxkd
Expand All @@ -45,7 +45,6 @@ services:
--node.enablePlugins=remotelog,networkdelay,spammer,prometheus
--database.directory=/app/mainnetdb
--node.peerDBDirectory=/app/peerdb
--manaInitializer.FaucetAPI=faucet-01.devnet.shimmer.iota.cafe:8080
--logger.level=info
--logger.disableEvents=false
--logger.remotelog.serverAddress=metrics-01.devnet.shimmer.iota.cafe:5213
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gin-gonic/gin v1.7.0
github.com/go-resty/resty/v2 v2.6.0
github.com/gorilla/websocket v1.5.0
github.com/iotaledger/hive.go v0.0.0-20220714071841-4f9c6ffe833a
github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0
github.com/libp2p/go-libp2p v0.15.0
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/iotaledger/hive.go v0.0.0-20220705110659-84be3e28c8ce h1:r6nyywvjxrFwC6qE9NcU/cWaLL8XWyzPtvQ0UfYGGmE=
github.com/iotaledger/hive.go v0.0.0-20220705110659-84be3e28c8ce/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/iotaledger/hive.go v0.0.0-20220713131416-10a47a2d9944 h1:ARmT1GEX1XxOah061u7AXsnegFqYsRu/rge5fuBINts=
github.com/iotaledger/hive.go v0.0.0-20220713131416-10a47a2d9944/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/iotaledger/hive.go v0.0.0-20220714061633-953e10f60c45 h1:tKgADjyZLNzcI5/pd/oW3rhcvGPq9yYODjqwrltqw2M=
github.com/iotaledger/hive.go v0.0.0-20220714061633-953e10f60c45/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/iotaledger/hive.go v0.0.0-20220714071841-4f9c6ffe833a h1:052kOYS5MjFWQrbS3mRzWERRrxAgXaZQBjDQRsWxWNU=
github.com/iotaledger/hive.go v0.0.0-20220714071841-4f9c6ffe833a/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663 h1:9Iyp28UlCFLJ4inXjU7zx5WwpgvsJx8WoFiwP+SmoFQ=
github.com/iotaledger/hive.go v0.0.0-20220714132400-7fd91bb37663/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
Expand Down
3 changes: 2 additions & 1 deletion packages/epoch/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"fmt"
"time"

"github.com/iotaledger/goshimmer/packages/clock"
"github.com/iotaledger/hive.go/generics/model"
"github.com/iotaledger/hive.go/serix"
"github.com/mr-tron/base58"
"golang.org/x/crypto/blake2b"

"github.com/iotaledger/goshimmer/packages/clock"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions packages/firewall/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import (
"github.com/iotaledger/hive.go/identity"
"github.com/iotaledger/hive.go/logger"

"github.com/iotaledger/goshimmer/packages/gossip"
"github.com/iotaledger/goshimmer/packages/p2p"
)

// Firewall is a object responsible for taking actions on faulty peers.
type Firewall struct {
gossipMgr *gossip.Manager
p2pManager *p2p.Manager
autopeering *selection.Protocol
log *logger.Logger
peersFaultinessCountMutex sync.RWMutex
peersFaultinessCount map[identity.ID]int
}

// NewFirewall create a new instance of Firewall object.
func NewFirewall(gossipMgr *gossip.Manager, autopeering *selection.Protocol, log *logger.Logger) (*Firewall, error) {
func NewFirewall(p2pManager *p2p.Manager, autopeering *selection.Protocol, log *logger.Logger) (*Firewall, error) {
return &Firewall{
gossipMgr: gossipMgr,
p2pManager: p2pManager,
autopeering: autopeering,
log: log,
peersFaultinessCount: map[identity.ID]int{},
Expand All @@ -48,20 +48,20 @@ func (f *Firewall) HandleFaultyPeer(peerID identity.ID, details *FaultinessDetai
logKVList := append([]interface{}{"peerId", peerID}, details.toKVList()...)
f.log.Infow("Peer is faulty, executing firewall logic to handle the peer", logKVList...)
f.incrPeerFaultinessCount(peerID)
nbr, err := f.gossipMgr.GetNeighbor(peerID)
nbr, err := f.p2pManager.GetNeighbor(peerID)
if err != nil {
f.log.Errorw("Can't get neighbor info from the gossip manager", "peerId", peerID, "err", err)
return
}
if nbr.Group == gossip.NeighborsGroupAuto {
if nbr.Group == p2p.NeighborsGroupAuto {
if f.autopeering != nil {
f.log.Infow(
"Blocklisting peer in the autopeering selection",
"peerId", peerID,
)
f.autopeering.BlockNeighbor(peerID)
}
} else if nbr.Group == gossip.NeighborsGroupManual {
} else if nbr.Group == p2p.NeighborsGroupManual {
f.log.Warnw("To the node operator. One of neighbors connected via manual peering acts faulty, no automatic actions taken. Consider removing it from the known peers list.",
logKVList...)
}
Expand Down
18 changes: 0 additions & 18 deletions packages/gossip/common.go

This file was deleted.

8 changes: 0 additions & 8 deletions packages/gossip/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,4 @@ import "github.com/cockroachdb/errors"
var (
// ErrNotRunning is returned when a neighbor is added to a stopped or not yet started gossip manager.
ErrNotRunning = errors.New("manager not running")
// ErrUnknownNeighbor is returned when the specified neighbor is not known to the gossip manager.
ErrUnknownNeighbor = errors.New("unknown neighbor")
// ErrLoopbackNeighbor is returned when the own peer is specified as a neighbor.
ErrLoopbackNeighbor = errors.New("loopback connection not allowed")
// ErrDuplicateNeighbor is returned when the same peer is added more than once as a neighbor.
ErrDuplicateNeighbor = errors.New("already connected")
// ErrNeighborQueueFull is returned when the send queue is already full.
ErrNeighborQueueFull = errors.New("send queue is full")
)
61 changes: 4 additions & 57 deletions packages/gossip/events.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gossip

import (
pb "github.com/iotaledger/goshimmer/packages/gossip/gossipproto"
"github.com/iotaledger/hive.go/autopeering/peer"
"github.com/iotaledger/hive.go/generics/event"
)
Expand All @@ -12,13 +11,6 @@ type Events struct {
BlockReceived *event.Event[*BlockReceivedEvent]
}

// newEvents returns a new Events object.
func newEvents() (new *Events) {
return &Events{
BlockReceived: event.New[*BlockReceivedEvent](),
}
}

// BlockReceivedEvent holds data about a block received event.
type BlockReceivedEvent struct {
// The raw block.
Expand All @@ -27,54 +19,9 @@ type BlockReceivedEvent struct {
Peer *peer.Peer
}

// NeighborsEvents is a collection of events specific for a particular neighbors group, e.g "manual" or "auto".
type NeighborsEvents struct {
// Fired when a neighbor connection has been established.
NeighborAdded *event.Event[*NeighborAddedEvent]

// Fired when a neighbor has been removed.
NeighborRemoved *event.Event[*NeighborRemovedEvent]
}

// NewNeighborsEvents returns a new instance of NeighborsEvents.
func NewNeighborsEvents() (new *NeighborsEvents) {
return &NeighborsEvents{
NeighborAdded: event.New[*NeighborAddedEvent](),
NeighborRemoved: event.New[*NeighborRemovedEvent](),
}
}

// NeighborAddedEvent holds data about the added neighbor.
type NeighborAddedEvent struct {
Neighbor *Neighbor
}

// NeighborAddedEvent holds data about the removed neighbor.
type NeighborRemovedEvent struct {
Neighbor *Neighbor
}

// NeighborEvents is a collection of events specific to a neighbor.
type NeighborEvents struct {
// Fired when a neighbor disconnects.
Disconnected *event.Event[*NeighborDisconnectedEvent]

// Fired when a packet is received from a neighbor.
PacketReceived *event.Event[*NeighborPacketReceivedEvent]
}

// NewNeighborsEvents returns a new instance of NeighborsEvents.
func NewNeighborEvents() (new *NeighborEvents) {
return &NeighborEvents{
Disconnected: event.New[*NeighborDisconnectedEvent](),
PacketReceived: event.New[*NeighborPacketReceivedEvent](),
// newEvents returns a new Events object.
func newEvents() (new *Events) {
return &Events{
BlockReceived: event.New[*BlockReceivedEvent](),
}
}

// NeighborDisconnectedEvent holds data about the disconnected neighbor.
type NeighborDisconnectedEvent struct{}

// NeighborDisconnectedEvent holds data about the disconnected neighbor.
type NeighborPacketReceivedEvent struct {
Packet *pb.Packet
}
Loading

0 comments on commit af7437a

Please sign in to comment.