Skip to content

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed
 

‎light/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func NewClientFromTrustedStore(
240240

241241
// Validate the number of witnesses.
242242
if len(c.witnesses) < 1 {
243-
return nil, errNoWitnesses{}
243+
return nil, ErrNoWitnesses
244244
}
245245

246246
// Verify witnesses are all on the same chain.
@@ -1127,7 +1127,7 @@ func (c *Client) compareFirstHeaderWithWitnesses(ctx context.Context, h *types.S
11271127
defer c.providerMutex.Unlock()
11281128

11291129
if len(c.witnesses) < 1 {
1130-
return errNoWitnesses{}
1130+
return ErrNoWitnesses
11311131
}
11321132

11331133
errc := make(chan error, len(c.witnesses))

‎light/detector.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (c *Client) detectDivergence(ctx context.Context, primaryTrace []*types.Lig
4141
defer c.providerMutex.Unlock()
4242

4343
if len(c.witnesses) == 0 {
44-
return errNoWitnesses{}
44+
return ErrNoWitnesses
4545
}
4646

4747
// launch one goroutine per witness to retrieve the light block of the target height

‎light/errors.go

-8
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ func (e errConflictingHeaders) Error() string {
8989
e.Block.Hash(), e.WitnessIndex)
9090
}
9191

92-
// errNoWitnesses means that there are not enough witnesses connected to
93-
// continue running the light client.
94-
type errNoWitnesses struct{}
95-
96-
func (e errNoWitnesses) Error() string {
97-
return "no witnesses connected. please reset light client"
98-
}
99-
10092
// errBadWitness is returned when the witness either does not respond or
10193
// responds with an invalid header.
10294
type errBadWitness struct {

‎mempool/reactor.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ func (memR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
181181
}
182182
for _, tx := range msg.Txs {
183183
err = memR.mempool.CheckTx(tx, nil, txInfo)
184-
if err != nil {
184+
if err == ErrTxInCache {
185+
memR.Logger.Debug("Tx already exists in cache", "tx", txID(tx))
186+
} else if err != nil {
185187
memR.Logger.Info("Could not check tx", "tx", txID(tx), "err", err)
186188
}
187189
}

‎test/e2e/runner/perturb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func PerturbNode(node *e2e.Node, perturbation e2e.Perturbation) (*rpctypes.Resul
6666
return nil, fmt.Errorf("unexpected perturbation %q", perturbation)
6767
}
6868

69-
status, err := waitForNode(node, 0, 10*time.Second)
69+
status, err := waitForNode(node, 0, 20*time.Second)
7070
if err != nil {
7171
return nil, err
7272
}

‎test/e2e/runner/start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func Start(testnet *e2e.Testnet) error {
7575
if err := execCompose(testnet.Dir, "up", "-d", node.Name); err != nil {
7676
return err
7777
}
78-
status, err := waitForNode(node, node.StartAt, 1*time.Minute)
78+
status, err := waitForNode(node, node.StartAt, 3*time.Minute)
7979
if err != nil {
8080
return err
8181
}

‎test/e2e/tests/app_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func TestApp_Tx(t *testing.T) {
8686
require.NoError(t, err)
8787

8888
hash := tx.Hash()
89-
waitTime := 20 * time.Second
89+
waitTime := 30 * time.Second
9090
require.Eventuallyf(t, func() bool {
9191
txResp, err := client.Tx(ctx, hash, false)
9292
return err == nil && bytes.Equal(txResp.Tx, tx)

0 commit comments

Comments
 (0)
Please sign in to comment.