Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Pull changes from upstream 0.34.x release #562

Merged
merged 19 commits into from
Oct 18, 2021
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
093961a
test: install abci-cli when running make tests_integrations (#6834)
williambanfield Aug 17, 2021
2db1e42
e2e: avoid starting nodes from the future (#6835) (#6838)
mergify[bot] Aug 18, 2021
4023580
e2e: cleanup node start function (#6842) (#6848)
mergify[bot] Aug 20, 2021
0c05841
internal/consensus: update error log (#6863) (#6867)
mergify[bot] Aug 26, 2021
e0c6199
abci: change client to use multi-reader mutexes (backport #6306) (#6873)
mergify[bot] Aug 30, 2021
73ef267
statesync: improve stateprovider handling in the syncer (backport) (#…
cmwaters Sep 1, 2021
0f8932f
light: fix early erroring (#6905)
cmwaters Sep 7, 2021
8ba6d21
Backport the psql indexer into v0.34.x (#6906)
Sep 7, 2021
849461a
Release v0.34.13
Sep 8, 2021
294a969
e2e: backport minor reliability improvements (#6967)
tychoish Sep 21, 2021
2d8287d
e2e: allow running of single node using the e2e app (backport) (#7024)
cmwaters Sep 29, 2021
474ed04
Import Postgres driver support for the psql indexer (backport). (#7057)
Oct 4, 2021
16ba782
cli: allow node operator to rollback last state (backport #7033) (#7080)
mergify[bot] Oct 8, 2021
9f13b9b
e2e: abci protocol should be consistent across networks (backport #70…
mergify[bot] Oct 8, 2021
1dfb345
e2e: light nodes should use builtin abci app (#7095) (#7096)
mergify[bot] Oct 9, 2021
a82cb7d
Revert "abci: change client to use multi-reader mutexes (#6306)" (bac…
mergify[bot] Oct 12, 2021
ff2758b
dep: remove IAVL dependency (backport #6550) (#7104)
cmwaters Oct 12, 2021
85870de
release: prepare changelog for 0.34.14 (#7105)
cmwaters Oct 13, 2021
4532105
Merge branch 'v0.34.x' of github.com:tendermint/tendermint into evan/…
evan-forbes Oct 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
light: fix early erroring (#6905)
  • Loading branch information
cmwaters authored Sep 7, 2021
commit 0f8932f4ef95549a3fefa030f9e2009c5ea59455
17 changes: 11 additions & 6 deletions light/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func NewClientFromTrustedStore(
}

// Validate the number of witnesses.
if len(c.witnesses) < 1 {
if len(c.witnesses) == 0 {
return nil, ErrNoWitnesses
}

Expand Down Expand Up @@ -1001,14 +1001,14 @@ func (c *Client) lightBlockFromPrimary(ctx context.Context, height int64) (*type

case provider.ErrNoResponse, provider.ErrLightBlockNotFound, provider.ErrHeightTooHigh:
// we find a new witness to replace the primary
c.logger.Debug("error from light block request from primary, replacing...",
c.logger.Info("error from light block request from primary, replacing...",
"error", err, "height", height, "primary", c.primary)
return c.findNewPrimary(ctx, height, false)

default:
// The light client has most likely received either provider.ErrUnreliableProvider or provider.ErrBadLightBlock
// These errors mean that the light client should drop the primary and try with another provider instead
c.logger.Error("error from light block request from primary, removing...",
c.logger.Info("error from light block request from primary, removing...",
"error", err, "height", height, "primary", c.primary)
return c.findNewPrimary(ctx, height, true)
}
Expand Down Expand Up @@ -1046,7 +1046,7 @@ func (c *Client) findNewPrimary(ctx context.Context, height int64, remove bool)
c.providerMutex.Lock()
defer c.providerMutex.Unlock()

if len(c.witnesses) <= 1 {
if len(c.witnesses) == 0 {
return nil, ErrNoWitnesses
}

Expand Down Expand Up @@ -1117,6 +1117,11 @@ func (c *Client) findNewPrimary(ctx context.Context, height int64, remove bool)
}
}

// remove witnesses marked as bad. Removal is done in descending order
if err := c.removeWitnesses(witnessesToRemove); err != nil {
c.logger.Error("failed to remove witnesses", "err", err, "witnessesToRemove", witnessesToRemove)
}

return nil, lastError
}

Expand All @@ -1129,7 +1134,7 @@ func (c *Client) compareFirstHeaderWithWitnesses(ctx context.Context, h *types.S
c.providerMutex.Lock()
defer c.providerMutex.Unlock()

if len(c.witnesses) < 1 {
if len(c.witnesses) == 0 {
return ErrNoWitnesses
}

Expand Down Expand Up @@ -1171,7 +1176,7 @@ and remove witness. Otherwise, use the different primary`, e.WitnessIndex), "wit

// remove witnesses that have misbehaved
if err := c.removeWitnesses(witnessesToRemove); err != nil {
return err
c.logger.Error("failed to remove witnesses", "err", err, "witnessesToRemove", witnessesToRemove)
}

return nil
Expand Down