Skip to content

Commit

Permalink
Merge pull request #865 from iotaledger/develop
Browse files Browse the repository at this point in the history
Merge v0.3.2 changes to master
  • Loading branch information
capossele authored Dec 9, 2020
2 parents b16eeb4 + 0162e5d commit dfef9f5
Show file tree
Hide file tree
Showing 93 changed files with 2,599 additions and 780 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:1.1.3
docker pull gaiaadm/pumba:latest
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
- name: Run integration tests
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:1.1.3
docker pull gaiaadm/pumba:latest
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
- name: Run integration tests
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
- name: Pull additional Docker images
run: |
docker pull angelocapossele/drand:1.1.3
docker pull gaiaadm/pumba:latest
docker pull gaiaadm/pumba:0.7.2
docker pull gaiadocker/iproute2:latest
- name: Run integration tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
- name: Copy config.default.json to config.json
run: cp config.default.json config.json
- name: Run GoReleaser
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.14.4
- name: Set up Go 1.15.5
uses: actions/setup-go@v1
with:
go-version: 1.14.4
go-version: 1.15.5

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v0.3.2 - 2020-12-09
* Switch from BadgerDB to Pebble.
* Add FPC statements.
* Add clock based time to message metadata.
* Improve dashboard message live feed.
* Improve spammer to evenly distribute issued messages within a minute.
* Fix panic when writing on a closed channel in the dashboard web socket.
* Upgrade Go to 1.15.5
* Upgrade to latest hive.go
* **Breaking**: bumps network and database versions

# v0.3.1 - 2020-11-13
* Refactor message structure according to the new Tangle RFC:
* add support for multiple parents
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
############################
# Build
############################
# golang:1.14.4-buster
FROM golang@sha256:fbaba67d3bd0a6fd154eaa27d1a0a9e5e80ecdb0792736017fde7326d9bf8d69 AS build
# golang:1.15.5-buster
FROM golang@sha256:eb88b20326f70fbf943af9d62650d8293d62fb5764c50e7477cdcb33caf9ff73 AS build

# Ensure ca-certficates are up to date
RUN update-ca-certificates
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ proto: $(PROTO_GO_FILES)

# If $GOPATH/bin/protoc-gen-go does not exist, we'll run this command to install it.
$(PROTOC_GEN_GO):
(GO111MODULE=off go get -v github.com/golang/protobuf/protoc-gen-go)
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc

# Implicit compile rule for GRPC/proto files
%.pb.go: %.proto | $(PROTOC_GEN_GO)
protoc $< --go_out=plugins=grpc,paths=source_relative:.
protoc $< --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:.

.PHONY: clean_proto
clean_proto:
Expand Down
35 changes: 8 additions & 27 deletions dapps/valuetransfers/dapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/transaction"
"github.com/iotaledger/goshimmer/packages/shutdown"
"github.com/iotaledger/goshimmer/packages/tangle"
"github.com/iotaledger/goshimmer/packages/vote"
"github.com/iotaledger/goshimmer/plugins/config"
"github.com/iotaledger/goshimmer/plugins/database"
"github.com/iotaledger/goshimmer/plugins/messagelayer"
Expand Down Expand Up @@ -57,7 +56,8 @@ var (
tangleOnce sync.Once

// fcob contains the fcob consensus logic.
fcob *consensus.FCOB
fcob *consensus.FCOB
fcobOnce sync.Once

// ledgerState represents the ledger state, that keeps track of the liked branches and offers an API to access funds.
ledgerState *valuetangle.LedgerState
Expand Down Expand Up @@ -92,6 +92,12 @@ func Tangle() *valuetangle.Tangle {
// FCOB gets the fcob instance.
// fcob contains the fcob consensus logic.
func FCOB() *consensus.FCOB {
fcobOnce.Do(func() {
// configure FCOB consensus rules
cfgAvgNetworkDelay := config.Node().Int(CfgValueLayerFCOBAverageNetworkDelay)
log.Infof("avg. network delay configured to %d seconds", cfgAvgNetworkDelay)
fcob = consensus.NewFCOB(_tangle, time.Duration(cfgAvgNetworkDelay)*time.Second)
})
return fcob
}

Expand Down Expand Up @@ -139,29 +145,6 @@ func configure(_ *node.Plugin) {
cachedPayloadEvent.Payload.Consume(tipManager.AddTip)
}))

// configure FCOB consensus rules
cfgAvgNetworkDelay := config.Node().Int(CfgValueLayerFCOBAverageNetworkDelay)
log.Infof("avg. network delay configured to %d seconds", cfgAvgNetworkDelay)
fcob = consensus.NewFCOB(_tangle, time.Duration(cfgAvgNetworkDelay)*time.Second)
fcob.Events.Vote.Attach(events.NewClosure(func(id string, initOpn vote.Opinion) {
if err := voter.Vote(id, initOpn); err != nil {
log.Warnf("FPC vote: %s", err)
}
}))
fcob.Events.Error.Attach(events.NewClosure(func(err error) {
log.Errorf("FCOB error: %s", err)
}))

// configure FPC + link to consensus
configureFPC()
voter.Events().Finalized.Attach(events.NewClosure(fcob.ProcessVoteResult))
voter.Events().Finalized.Attach(events.NewClosure(func(ev *vote.OpinionEvent) {
log.Infof("FPC finalized for transaction with id '%s' - final opinion: '%s'", ev.ID, ev.Opinion)
}))
voter.Events().Failed.Attach(events.NewClosure(func(ev *vote.OpinionEvent) {
log.Warnf("FPC failed for transaction with id '%s' - last opinion: '%s'", ev.ID, ev.Opinion)
}))

// register SignatureFilter in Parser
messagelayer.MessageParser().AddMessageFilter(valuetangle.NewSignatureFilter())

Expand All @@ -178,8 +161,6 @@ func run(*node.Plugin) {
}, shutdown.PriorityTangle); err != nil {
log.Panicf("Failed to start as daemon: %s", err)
}

runFPC()
}

func onReceiveMessageFromMessageLayer(cachedMessageEvent *tangle.CachedMessageEvent) {
Expand Down
224 changes: 0 additions & 224 deletions dapps/valuetransfers/fpc.go

This file was deleted.

Loading

0 comments on commit dfef9f5

Please sign in to comment.