Skip to content

Commit f028843

Browse files
authored
Merge pull request #2302 from iotaledger/develop
Merge v0.9.1 into master
2 parents 3eec0b9 + a474eac commit f028843

File tree

159 files changed

+7001
-7553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+7001
-7553
lines changed

.github/workflows/feature-network-deploy.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ on:
77
required: false
88
default: ""
99
powDifficulty:
10-
description: 'PoW difficulty (default: 21):'
10+
description: 'PoW difficulty (default: 0):'
1111
required: false
1212
default: ""
13+
remoteDebugging:
14+
description: 'Enable debugger (0/1):'
15+
required: true
16+
default: "0"
1317
jobs:
1418
deploy:
1519
environment: feature
@@ -45,7 +49,7 @@ jobs:
4549
build-args: |
4650
CUSTOM_SNAPSHOT_URL=${{github.event.inputs.snapshotUrl}}
4751
DEFAULT_SNAPSHOT_URL=https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/snapshots/feature/snapshot.bin
48-
REMOTE_DEBUGGING=1
52+
REMOTE_DEBUGGING=${{github.event.inputs.remoteDebugging}}
4953
cache-from: type=local,src=/tmp/.buildx-cache
5054
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
5155

CHANGELOG.md

+81-67
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1+
# v0.9.1 - 2022-06-22
2+
3+
> This release introduces the rate setter which allows nodes to estimate their fair rate of block creation and makes removing proof-of-work possible. Congestion is completely handled by the rate-setter and congestion control algorithms (capped at 30 BPS). Access mana is not decaying and is pledged to the node until it's re-pledged to another node. The release also includes new time concepts which make the network more resilient against mana going offline which in the past caused confirmations to stop permanently.
4+
5+
The snapshot has been changed and thus the ledger state is fully reset.
6+
7+
- Fix mount volume (#2300)
8+
- Remove pow in default config.json (#2299)
9+
- Update TSC to compare tangle time with time of confirmed message. (#2167)
10+
- Adds rate setter in data flow (#1557)
11+
- Update congestion control documentation (#2097)
12+
- AccessMana is now Mana1 (#2271)
13+
- Fix: faucet waits longer for messages to be booked (#2280)
14+
- Correct pre-devnet and devnet identities in snapshot generation tool (#2279)
15+
116
# v0.9.0 - 2022-06-16
217

318
> This major release introduces concurrency throughout the node with asynchronous events and parallelized booking. This is achieved with serix, a generic deterministic serialization library, and through generic thread-safe data models. The ledger and conflictDAG and output processing (introduction of UTXO VM) have been completely rewritten. The Blockfactory received a total revamp as well and tip selection should show better behavior in resolving conflicts. In addition, a bunch of unused modules and code have been removed rendering the project overall more readable. The short identifier of a nodeID has been adjusted to show the first 8 characters of the full identity.
419
520
The snapshot has been changed and thus the ledger state is fully reset.
21+
622
- Refactor MessageFactory, introduce ReferenceProvider and OrphanageManager (#2240)
723
- Refactor models to be thread-safe with serix (#2248)
824
- Remove future markers (#2241)
@@ -19,7 +35,6 @@ The snapshot has been changed and thus the ledger state is fully reset.
1935
- GoReleaser dryrun on PRs (#2213)
2036
- Update marker docs (#2146)
2137

22-
2338
# v0.8.14 - 2022-05-16
2439

2540
> Minor revision introducing small docker changes.
@@ -38,7 +53,6 @@ The snapshot has been taken at 2022-05-04 15:05 UTC.
3853
- Feat/evil spammer improvements and fixes (#2191)
3954
- Fix bugs in evil spammer and tutorial (#2185)
4055

41-
4256
# v0.8.12 - 2022-04-25
4357

4458
> This release introduces the evil wallet and a fix where nodes could not express their opinion on conflicts properly.
@@ -786,10 +800,10 @@ Config key changes `config.default.json`:
786800

787801
# v0.3.1 - 2020-11-13
788802
* Refactor message structure according to the new Tangle RFC:
789-
* add support for multiple parents
790-
* update local dashboard
791-
* new unit tests
792-
* max payload size changed to 65157 bytes
803+
* add support for multiple parents
804+
* update local dashboard
805+
* new unit tests
806+
* max payload size changed to 65157 bytes
793807
* Add community-based entry node.
794808
* Add commit tag to version.
795809
* Add package for common sentinel errors.
@@ -832,39 +846,39 @@ Config key changes `config.default.json`:
832846
* Fixes synchronization issue where missing messages were not requested more than once
833847
* Fixes node's dashboard explorer crashing or not properly visualizing the payload of a given message
834848
* Improves Grafana local dashboard:
835-
* Adds support for the sync-beacon payload type
836-
* Displaying uptime and nodeID
849+
* Adds support for the sync-beacon payload type
850+
* Displaying uptime and nodeID
837851
* Fixed all linter issues to improve code quality
838852
* **Breaking**: bumps network and database versions
839853

840854
# v0.2.2 - 2020-07-27
841855
* Improves message and transaction validation:
842-
* Adjust max transaction inputs count;
843-
* Adds signature validation before issuance;
844-
* Enforce max message size in message factory.
856+
* Adjust max transaction inputs count;
857+
* Adds signature validation before issuance;
858+
* Enforce max message size in message factory.
845859
* Improves API:
846-
* Changes granularity of spammer API to accept messages per minute;
847-
* Adds API middleware and set CORS to allow from every origin;
848-
* Adds sendTransactionByJSON to allow a client to issue transactions by providing them in a JSON format;
849-
* Adds tool API endpoint to facilitate debugging of the solidification status;
850-
* Removes old API documentation;
860+
* Changes granularity of spammer API to accept messages per minute;
861+
* Adds API middleware and set CORS to allow from every origin;
862+
* Adds sendTransactionByJSON to allow a client to issue transactions by providing them in a JSON format;
863+
* Adds tool API endpoint to facilitate debugging of the solidification status;
864+
* Removes old API documentation;
851865
* Improves synchronization process:
852-
* Refactors message requester to be more reliable;
853-
* Improves solidification process;
854-
* Refactors worker pool management;
855-
* Replaces bootstrap plugin with the more secure and reliable beacon plugin.
866+
* Refactors message requester to be more reliable;
867+
* Improves solidification process;
868+
* Refactors worker pool management;
869+
* Replaces bootstrap plugin with the more secure and reliable beacon plugin.
856870
* Improves analysis-server dashboard:
857-
* Adds the ability to distinguish between different GoShimmer node versions;
858-
* Refactors the interaction between server side and dashboard;
859-
* Improves consensus visualization;
860-
* Improves dashboard tooling.
871+
* Adds the ability to distinguish between different GoShimmer node versions;
872+
* Refactors the interaction between server side and dashboard;
873+
* Improves consensus visualization;
874+
* Improves dashboard tooling.
861875
* Adds a new electron-based wallet.
862876
* Increases max gossip packet size.
863877
* Adds command to the CLI to override database dirty flag.
864878
* Grafana local dashboard
865-
* Adds messages in database chart (solid, not solid, total)
866-
* Adds average solidification time chart
867-
* Adds Message Request Queue Size chart
879+
* Adds messages in database chart (solid, not solid, total)
880+
* Adds average solidification time chart
881+
* Adds Message Request Queue Size chart
868882
* **Breaking**: bumps network and database versions
869883

870884
# v0.2.1 - 2020-07-01
@@ -875,52 +889,52 @@ Config key changes `config.default.json`:
875889

876890
# v0.2.0 - 2020-06-30
877891
* Adds the value transfer dApp:
878-
* New binary transaction layout
879-
* UTXO model
880-
* Support for transactions with Ed25519 and BLS signatures
881-
* Parallel reality based ledger state
882-
* Support for colored tokens
883-
* Conflict resolution via FPC
884-
* Applied FCoB rules
892+
* New binary transaction layout
893+
* UTXO model
894+
* Support for transactions with Ed25519 and BLS signatures
895+
* Parallel reality based ledger state
896+
* Support for colored tokens
897+
* Conflict resolution via FPC
898+
* Applied FCoB rules
885899
* Adds the network delay dApp which is used to gather the avg. network delay occurring in the network
886900
* Adds the faucet dApp giving the ability to request funds for testing via the dashboard or web API
887901
* Adds the DRNG dApp which is used to propagate random numbers produced by a dRand committee (this dApp is inactive)
888902
* Adds the base communication layer
889903
* Adds improved analysis server:
890-
* Splits it into 3 separate plugins `analysis-client`/`analysis-dashboard`/`analysis-server`
891-
* Applies heartbeat pattern for robustness on both client and server side
892-
* Uses TLV denoted messages for communication
893-
* Complete new dashboard with live visualisations of the network graph and ongoing conflicts
894-
* Use short node IDs throughout the analysis dashboard
895-
* Prometheus exporter to expose global network metrics
896-
* Storage for conflicts inside a MongoDB for further processing
897-
* Complete rewritten autopeering data retention
904+
* Splits it into 3 separate plugins `analysis-client`/`analysis-dashboard`/`analysis-server`
905+
* Applies heartbeat pattern for robustness on both client and server side
906+
* Uses TLV denoted messages for communication
907+
* Complete new dashboard with live visualisations of the network graph and ongoing conflicts
908+
* Use short node IDs throughout the analysis dashboard
909+
* Prometheus exporter to expose global network metrics
910+
* Storage for conflicts inside a MongoDB for further processing
911+
* Complete rewritten autopeering data retention
898912
* Adds additional HTTP API routes:
899-
* "healtz" route to query the health of the node (for LBs)
900-
* Query transaction attachment locations
901-
* Query transactions by IDs
902-
* Send transactions
903-
* Get UTXOs on addresses
904-
* Query info about the node
905-
* Issue a faucet funding request
906-
* Query dRNG committee
907-
* Query dRNG random number
908-
* Issue data payloads
913+
* "healtz" route to query the health of the node (for LBs)
914+
* Query transaction attachment locations
915+
* Query transactions by IDs
916+
* Send transactions
917+
* Get UTXOs on addresses
918+
* Query info about the node
919+
* Issue a faucet funding request
920+
* Query dRNG committee
921+
* Query dRNG random number
922+
* Issue data payloads
909923
* Adds dashboard improvements:
910-
* Tips chart
911-
* Communication layer visualizer
912-
* Address and UTXOs view
913-
* Message payload view
914-
* DRNG live feed
915-
* Faucet page to request funds
916-
* Support different payload views (data, value, faucet, unknown)
924+
* Tips chart
925+
* Communication layer visualizer
926+
* Address and UTXOs view
927+
* Message payload view
928+
* DRNG live feed
929+
* Faucet page to request funds
930+
* Support different payload views (data, value, faucet, unknown)
917931
* Adds integration test framework and corresponding tests:
918-
* Autopeering/Network Split
919-
* Message propagation
920-
* FPC 50/50 network split voting
921-
* Faucet funding
922-
* Value transfers
923-
* Synchronization
932+
* Autopeering/Network Split
933+
* Message propagation
934+
* FPC 50/50 network split voting
935+
* Faucet funding
936+
* Value transfers
937+
* Synchronization
924938
* Adds refactored communication layer code
925939
* Adds BLAKE2-based PoW for rate control
926940
* Adds rewritten FPC package
@@ -943,7 +957,7 @@ Config key changes `config.default.json`:
943957
* Fixes usage of WebSocket message rate limiter
944958
* Fixes disabled/enabled plugins list in info response
945959
* Fixes the `Graceful Shutdown` plugin not showing the actual background workers during shutdown. The node operator is now
946-
able to see pending background workers in the order in which they are supposed to be terminated
960+
able to see pending background workers in the order in which they are supposed to be terminated
947961
* Refactors display of IDs to use Base58 throughout the entire codebase
948962
* Increases network and database versions
949963
* Removes usage of non std `errors` package
@@ -956,7 +970,7 @@ able to see pending background workers in the order in which they are supposed t
956970
* Update SPA plugin's JS dependencies
957971
* Upgrade `github.com/gobuffalo/packr` to v2.8.0
958972
* Resolves a security issue in the packr dependency, which would allow an unauthenticated attacker to read any
959-
file from the application's filesystem
973+
file from the application's filesystem
960974

961975
# v0.1.2 - 2020-02-24
962976

client/evilspammer/errors.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ package evilspammer
22

33
import (
44
"fmt"
5+
"sync"
6+
57
"github.com/cockroachdb/errors"
68
"go.uber.org/atomic"
7-
"sync"
89
)
910

1011
var (
1112
ErrFailPostTransaction = errors.New("failed to post transaction")
1213
ErrFailSendDataMessage = errors.New("failed to send a data message")
14+
1315
ErrTransactionIsNil = errors.New("provided transaction is nil")
1416
ErrFailToPrepareBatch = errors.New("custom conflict batch could not be prepared")
1517
ErrInsufficientClients = errors.New("insufficient clients to send conflicts")

client/evilspammer/options.go

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ func WithSpamDuration(maxDuration time.Duration) Options {
3636
}
3737
}
3838

39+
// WithRateSetter enables setting rate of spammer.
40+
func WithRateSetter(enable bool) Options {
41+
return func(s *Spammer) {
42+
s.UseRateSetter = enable
43+
}
44+
}
45+
3946
// WithBatchesSent provides spammer with options regarding rate, time unit, and finishing spam criteria. Provide 0 to one of max parameters to skip it.
4047
func WithBatchesSent(maxBatchesSent int) Options {
4148
return func(s *Spammer) {

client/evilspammer/spammer.go

+21-9
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ type State struct {
3535
// Not mandatory options, if not provided spammer will use default settings:
3636
// WithSpamDetails, WithEvilWallet, WithErrorCounter, WithLogTickerInterval
3737
type Spammer struct {
38-
SpamDetails *SpamDetails
39-
State *State
40-
41-
Clients evilwallet.Connector
42-
EvilWallet *evilwallet.EvilWallet
43-
EvilScenario *evilwallet.EvilScenario
44-
ErrCounter *ErrorCounter
45-
log Logger
38+
SpamDetails *SpamDetails
39+
State *State
40+
UseRateSetter bool
41+
Clients evilwallet.Connector
42+
EvilWallet *evilwallet.EvilWallet
43+
EvilScenario *evilwallet.EvilScenario
44+
ErrCounter *ErrorCounter
45+
log Logger
4646

4747
// accessed from spamming functions
4848
done chan bool
@@ -65,6 +65,7 @@ func NewSpammer(options ...Options) *Spammer {
6565
spamFunc: CustomConflictSpammingFunc,
6666
State: state,
6767
EvilScenario: evilwallet.NewEvilScenario(),
68+
UseRateSetter: true,
6869
done: make(chan bool),
6970
shutdown: make(chan types.Empty),
7071
NumberOfSpends: 2,
@@ -148,6 +149,7 @@ func (s *Spammer) Spam() {
148149
timeExceeded := time.After(s.SpamDetails.MaxDuration)
149150

150151
go func() {
152+
goroutineCount := atomic.NewInt32(0)
151153
for {
152154
select {
153155
case <-s.State.logTicker.C:
@@ -160,7 +162,14 @@ func (s *Spammer) Spam() {
160162
s.StopSpamming()
161163
return
162164
case <-s.State.spamTicker.C:
163-
go s.spamFunc(s)
165+
if goroutineCount.Load() > 100 {
166+
break
167+
}
168+
go func() {
169+
goroutineCount.Inc()
170+
defer goroutineCount.Dec()
171+
s.spamFunc(s)
172+
}()
164173
}
165174
}
166175
}()
@@ -200,6 +209,9 @@ func (s *Spammer) PostTransaction(tx *devnetvm.Transaction, clt evilwallet.Clien
200209

201210
var err error
202211
var txID utxo.TransactionID
212+
if err = evilwallet.RateSetterSleep(clt, s.UseRateSetter); err != nil {
213+
return
214+
}
203215
txID, err = clt.PostTransaction(tx)
204216
if err != nil {
205217
s.log.Debug(ErrFailPostTransaction)

client/evilspammer/spamming_functions.go

+14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package evilspammer
22

33
import (
44
"fmt"
5+
"math/rand"
56
"sync"
7+
"time"
68

79
"github.com/cockroachdb/errors"
810

@@ -12,10 +14,16 @@ import (
1214

1315
func DataSpammingFunction(s *Spammer) {
1416
clt := s.Clients.GetClient()
17+
// sleep randomly to avoid issuing messages in different goroutines at once
18+
time.Sleep(time.Duration(rand.Float64()*20) * time.Millisecond)
19+
if err := evilwallet.RateSetterSleep(clt, s.UseRateSetter); err != nil {
20+
s.ErrCounter.CountError(err)
21+
}
1522
msgID, err := clt.PostData([]byte(fmt.Sprintf("SPAM")))
1623
if err != nil {
1724
s.ErrCounter.CountError(ErrFailSendDataMessage)
1825
}
26+
1927
count := s.State.txSent.Add(1)
2028
if count%int64(s.SpamDetails.Rate*2) == 0 {
2129
s.log.Debugf("Last sent message, ID: %s; msgCount: %d", msgID, count)
@@ -44,6 +52,12 @@ func CustomConflictSpammingFunc(s *Spammer) {
4452
wg.Add(1)
4553
go func(clt evilwallet.Client, tx *devnetvm.Transaction) {
4654
defer wg.Done()
55+
56+
// sleep randomly to avoid issuing messages in different goroutines at once
57+
time.Sleep(time.Duration(rand.Float64()*100) * time.Millisecond)
58+
if err = evilwallet.RateSetterSleep(clt, s.UseRateSetter); err != nil {
59+
s.ErrCounter.CountError(err)
60+
}
4761
s.PostTransaction(tx, clt)
4862
}(clients[i], tx)
4963
}

0 commit comments

Comments
 (0)