Skip to content

Commit

Permalink
chore(release): update changelog and bump version to 1.1.0 (#851)
Browse files Browse the repository at this point in the history
* feat!: replace dash core quorum sign with quorum platformsign (#828)

* feat: replace  dash core quorum sign with quorum platformsign

* chore: fix Docker legacy warning

* test(e2e): fix e2e quorum sign mock

* build(deps): update dashd-go to v0.25.0

* build(deps): Bump bufbuild/buf-setup-action from 1.33.0 to 1.35.0 (#841)

Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.33.0 to 1.35.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](bufbuild/buf-setup-action@v1.33.0...v1.35.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(dependabot): run dependabot on default branch, not master (#843)

* chore(release): update changelog and version to 1.1.0-dev.1 (#842)

* fix: address already in use (#845)

* fix: address already in use

* fix: always sleep

* fix: active validators not always connected to each other (#844)

* chore(dash): decrease log verbosity in validator conn executor

* fix(node): validator conn executor not started correctly

* fix: panic on full node

* fix: dash dialer fails to lookup nodes in addressbook

* chore(release): update changelog and version to 1.1.0-dev.2 (#846)

* feat(abci): allow overriding genesis time in InitChain (#847)

* chore(release): update changelog and version to 1.1.0-dev.3 (#848)

* fix: validators form islands on genesis (#850)

* chore(release): update changelog and version to 1.1.0

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ivan Shumkov <[email protected]>
  • Loading branch information
3 people authored Jul 29, 2024
1 parent 40266dc commit 00c8f57
Show file tree
Hide file tree
Showing 21 changed files with 738 additions and 420 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ updates:
directory: "/"
schedule:
interval: weekly
target-branch: "master"
open-pull-requests-limit: 10
reviewers:
- shumkov
- lklimek
labels:
- dependencies
2 changes: 1 addition & 1 deletion .github/workflows/proto-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.33.0
- uses: bufbuild/buf-setup-action@v1.35.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
## [1.0.0] - 2024-06-26
## [1.1.0] - 2024-07-29

### Bug Fixes

- Address already in use (#845)
- Active validators not always connected to each other (#844)
- Validators form islands on genesis (#850)

### Features

- [**breaking**] Replace dash core quorum sign with quorum platformsign (#828)
- Allow overriding genesis time in InitChain (#847)

### Miscellaneous Tasks

- Update changelog and version to 1.1.0-dev.1 (#842)
- Update changelog and version to 1.1.0-dev.2 (#846)
- Update changelog and version to 1.1.0-dev.3 (#848)

### Build

- Bump bufbuild/buf-setup-action from 1.33.0 to 1.35.0 (#841)
- Run dependabot on default branch, not master (#843)

## [1.0.0] - 2024-07-01

### Bug Fixes

Expand Down Expand Up @@ -43,6 +67,7 @@
- Detect quorum hash mismatch when verifying commit (#791)
- Update changelog and version to 0.14.0-dev.8 (#792)
- Update changelog and version to 1.0.0-dev.2 (#806)
- Update changelog and version to 1.0.0

### Refactor

Expand Down Expand Up @@ -94,6 +119,7 @@
- Bump docker/build-push-action from 5.4.0 to 6.0.0 (#801)
- Bump bufbuild/buf-setup-action from 1.32.2 to 1.33.0 (#800)
- Bump goreleaser/goreleaser-action from 5 to 6 (#798)
- Bump github.com/stretchr/testify from 1.8.2 to 1.9.0 (#817)

## [0.13.4] - 2023-12-11

Expand Down
2 changes: 1 addition & 1 deletion DOCKER/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ LABEL maintainer="[email protected]"
# private validator file into /tenderdash/config.
#
# The /tenderdash/data dir is used by tenderdash to store state.
ENV TMHOME /tenderdash
ENV TMHOME=/tenderdash

# OS environment setup
# Set user right away for determinism, create directory for persistence and give our user ownership
Expand Down
40 changes: 38 additions & 2 deletions DOCKER/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
#!/bin/bash
set -e


# TODO: Workaround for busy port problem happening with docker restart policy
# we are trying to start a new container but previous process still not release
# the port.

# As a workaround we are sleeping for 10 seconds after the tenderdash process
# exits with non-zero exit code.
#
# Must be fix with graceful shutdown of tenderdash process.

got_signal=false

# Function to handle signals and forward them to the tenderdash process
# shellcheck disable=SC2317
_forward_signal() {
echo "Caught signal! Forwarding to tenderdash process."
got_signal=true
kill -s "$1" "$child"
}

# Trap signals and forward them to the tenderdash process
trap '_forward_signal TERM' SIGTERM
trap '_forward_signal INT' SIGINT
trap '_forward_signal HUP' SIGHUP
trap '_forward_signal QUIT' SIGQUIT

if [ ! -d "$TMHOME/config" ]; then
echo "Running tenderdash init to create a single node (default) configuration for docker run."
Expand All @@ -26,4 +51,15 @@ if [ ! -d "$TMHOME/config" ]; then
mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json"
fi

exec tenderdash "$@"
# Start tenderdash in the background
tenderdash "$@" &
child=$!
wait "$child"
exit_code=$?

if [ $got_signal == false ] && [ $exit_code -ne 0 ] && [ "$1" == "start" ]; then
echo "Sleeping for 10 seconds as workaround for the busy port problem. See entrypoint code for details."
sleep 10
fi

exit $exit_code
582 changes: 349 additions & 233 deletions abci/types/types.pb.go

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions dash/core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ func (rpcClient *RPCClient) QuorumSign(
if err := quorumType.Validate(); err != nil {
return nil, err
}
quorumSignResultWithBool, err := rpcClient.endpoint.QuorumSign(
quorumType,
quorumSignResultWithBool, err := rpcClient.endpoint.QuorumPlatformSign(
requestID.String(),
messageHash.String(),
quorumHash.String(),
false,
)

rpcClient.logger.Trace("core rpc call QuorumSign",
"quorumType", quorumType,
"requestID", requestID.String(),
Expand All @@ -192,7 +192,15 @@ func (rpcClient *RPCClient) QuorumSign(
if quorumSignResultWithBool == nil {
return nil, err
}

// as QuorumPlatformSign does not provide the quorum type, we need to check it manually
// to ensure we deliver what was requested by the caller
quorumSignResult := quorumSignResultWithBool.QuorumSignResult
if quorumType != btcjson.LLMQType(quorumSignResult.LLMQType) {
return nil, fmt.Errorf("possible misconfiguration: quorum platform sign uses unexpected quorum type %d, expected %d",
quorumSignResultWithBool.LLMQType, quorumType)
}

return &quorumSignResult, err
}

Expand Down
53 changes: 41 additions & 12 deletions dash/quorum/validator_conn_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/dashpay/tenderdash/internal/eventbus"
"github.com/dashpay/tenderdash/internal/p2p"
tmpubsub "github.com/dashpay/tenderdash/internal/pubsub"
"github.com/dashpay/tenderdash/internal/state"
tmbytes "github.com/dashpay/tenderdash/libs/bytes"
"github.com/dashpay/tenderdash/libs/log"
"github.com/dashpay/tenderdash/libs/service"
Expand Down Expand Up @@ -62,6 +63,9 @@ type ValidatorConnExecutor struct {
// mux is a mutex to ensure only one goroutine is processing connections
mux sync.Mutex

// state store used on start to setup initial validators
stateStore state.Store

// *** configuration *** //

// EventBusCapacity sets event bus buffer capacity, defaults to 10
Expand Down Expand Up @@ -120,6 +124,15 @@ func WithValidatorsSet(valSet *types.ValidatorSet) func(vc *ValidatorConnExecuto
}
}

// WithStateStore sets state store to be used when setting up initial validators
// Can be nil, in which case no initial validators will be set up.
func WithStateStore(store state.Store) func(vc *ValidatorConnExecutor) error {
return func(vc *ValidatorConnExecutor) error {
vc.stateStore = store
return nil
}
}

// WithLogger sets a logger
func WithLogger(logger log.Logger) func(vc *ValidatorConnExecutor) error {
return func(vc *ValidatorConnExecutor) error {
Expand All @@ -130,6 +143,22 @@ func WithLogger(logger log.Logger) func(vc *ValidatorConnExecutor) error {

// OnStart implements Service to subscribe to Validator Update events
func (vc *ValidatorConnExecutor) OnStart(ctx context.Context) error {
// initial setup of validators, if state store is provided
if vc.stateStore != nil {
valset, err := vc.stateStore.Load()
if err != nil {
return fmt.Errorf("cannot load initial state from state store: %w", err)
}
if err = vc.handleValidatorUpdateEvent(types.EventDataValidatorSetUpdate{
ValidatorSetUpdates: valset.Validators.Validators,
ThresholdPublicKey: valset.Validators.ThresholdPublicKey,
QuorumHash: valset.Validators.QuorumHash,
}); err != nil {
// not fatal, but we should log it
vc.logger.Warn("cannot handle initial validator set, skipping", "err", err)
}
}

if err := vc.subscribe(); err != nil {
return err
}
Expand Down Expand Up @@ -184,7 +213,7 @@ func (vc *ValidatorConnExecutor) subscribe() error {
// receiveEvents processes received events and executes all the logic.
// Returns non-nil error only if fatal error occurred and the main goroutine should be terminated.
func (vc *ValidatorConnExecutor) receiveEvents(ctx context.Context) error {
vc.logger.Debug("ValidatorConnExecutor: waiting for an event")
vc.logger.Trace("ValidatorConnExecutor: waiting for an event")
sCtx, cancel := context.WithCancel(ctx) // TODO check value for correctness
defer cancel()
msg, err := vc.subscription.Next(sCtx)
Expand All @@ -202,7 +231,7 @@ func (vc *ValidatorConnExecutor) receiveEvents(ctx context.Context) error {
vc.logger.Error("cannot handle validator update", "error", err)
return nil // non-fatal, so no error returned to continue the loop
}
vc.logger.Debug("validator updates processed successfully", "event", event)
vc.logger.Trace("validator updates processed successfully", "event", event)
return nil
}

Expand Down Expand Up @@ -264,7 +293,7 @@ func (vc *ValidatorConnExecutor) resolveNodeID(va *types.ValidatorAddress) error
va.NodeID = address.NodeID
return nil // success
}
vc.logger.Debug(
vc.logger.Trace(
"warning: validator node id lookup method failed",
"url", va.String(),
"method", method,
Expand Down Expand Up @@ -305,7 +334,7 @@ func (vc *ValidatorConnExecutor) ensureValidatorsHaveNodeIDs(validators []*types
for _, validator := range validators {
err := vc.resolveNodeID(&validator.NodeAddress)
if err != nil {
vc.logger.Error("cannot determine node id for validator, skipping", "url", validator.String(), "error", err)
vc.logger.Warn("cannot determine node id for validator, skipping", "url", validator.String(), "error", err)
continue
}
results = append(results, validator)
Expand All @@ -318,7 +347,7 @@ func (vc *ValidatorConnExecutor) disconnectValidator(validator types.Validator)
return err
}
id := validator.NodeAddress.NodeID
vc.logger.Debug("disconnecting Validator", "validator", validator, "id", id, "address", validator.NodeAddress.String())
vc.logger.Trace("disconnecting Validator", "validator", validator, "id", id, "address", validator.NodeAddress.String())
if err := vc.dialer.DisconnectAsync(id); err != nil {
return err
}
Expand All @@ -337,7 +366,7 @@ func (vc *ValidatorConnExecutor) disconnectValidators(exceptions validatorMap) e
vc.logger.Error("cannot disconnect Validator", "error", err)
continue
}
vc.logger.Debug("Validator already disconnected", "error", err)
vc.logger.Trace("Validator already disconnected", "error", err)
// We still delete the validator from vc.connectedValidators
}
delete(vc.connectedValidators, currentKey)
Expand Down Expand Up @@ -373,11 +402,11 @@ func (vc *ValidatorConnExecutor) updateConnections() error {
if err := vc.disconnectValidators(newValidators); err != nil {
return fmt.Errorf("cannot disconnect unused validators: %w", err)
}
vc.logger.Debug("filtering validators", "validators", newValidators.String())
vc.logger.Trace("filtering validators", "validators", newValidators.String())
// ensure that we can connect to all validators
newValidators = vc.filterAddresses(newValidators)
// Connect to new validators
vc.logger.Debug("dialing validators", "validators", newValidators.String())
vc.logger.Trace("dialing validators", "validators", newValidators.String())
if err := vc.dial(newValidators); err != nil {
return fmt.Errorf("cannot dial validators: %w", err)
}
Expand All @@ -390,20 +419,20 @@ func (vc *ValidatorConnExecutor) filterAddresses(validators validatorMap) valida
filtered := make(validatorMap, len(validators))
for id, validator := range validators {
if vc.proTxHash != nil && string(id) == vc.proTxHash.String() {
vc.logger.Debug("validator is ourself", "id", id, "address", validator.NodeAddress.String())
vc.logger.Trace("validator is ourself", "id", id, "address", validator.NodeAddress.String())
continue
}

if err := validator.ValidateBasic(); err != nil {
vc.logger.Debug("validator address is invalid", "id", id, "address", validator.NodeAddress.String())
vc.logger.Warn("validator address is invalid", "id", id, "address", validator.NodeAddress.String())
continue
}
if vc.connectedValidators.contains(validator) {
vc.logger.Debug("validator already connected", "id", id)
vc.logger.Trace("validator already connected", "id", id)
continue
}
if vc.dialer.IsDialingOrConnected(validator.NodeAddress.NodeID) {
vc.logger.Debug("already dialing this validator", "id", id, "address", validator.NodeAddress.String())
vc.logger.Trace("already dialing this validator", "id", id, "address", validator.NodeAddress.String())
continue
}

Expand Down
Loading

0 comments on commit 00c8f57

Please sign in to comment.