mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 19:51:39 +00:00
Backoff ignore invalid signatures (#1408)
This commit is contained in:
parent
1602df8752
commit
726ad6ce2e
@ -477,7 +477,12 @@ func (t *txnReq) lookupStateAfterEvent(ctx context.Context, roomVersion gomatrix
|
|||||||
|
|
||||||
// fetch the event we're missing and add it to the pile
|
// fetch the event we're missing and add it to the pile
|
||||||
h, err := t.lookupEvent(ctx, roomVersion, eventID, false)
|
h, err := t.lookupEvent(ctx, roomVersion, eventID, false)
|
||||||
if err != nil {
|
switch err.(type) {
|
||||||
|
case verifySigError:
|
||||||
|
return respState, nil
|
||||||
|
case nil:
|
||||||
|
// do nothing
|
||||||
|
default:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
t.haveEvents[h.EventID()] = h
|
t.haveEvents[h.EventID()] = h
|
||||||
@ -586,7 +591,15 @@ retryAllowedState:
|
|||||||
switch missing := err.(type) {
|
switch missing := err.(type) {
|
||||||
case gomatrixserverlib.MissingAuthEventError:
|
case gomatrixserverlib.MissingAuthEventError:
|
||||||
h, err2 := t.lookupEvent(ctx, roomVersion, missing.AuthEventID, true)
|
h, err2 := t.lookupEvent(ctx, roomVersion, missing.AuthEventID, true)
|
||||||
if err2 != nil {
|
switch err2.(type) {
|
||||||
|
case verifySigError:
|
||||||
|
return &gomatrixserverlib.RespState{
|
||||||
|
AuthEvents: authEventList,
|
||||||
|
StateEvents: resolvedStateEvents,
|
||||||
|
}, nil
|
||||||
|
case nil:
|
||||||
|
// do nothing
|
||||||
|
default:
|
||||||
return nil, fmt.Errorf("missing auth event %s and failed to look it up: %w", missing.AuthEventID, err2)
|
return nil, fmt.Errorf("missing auth event %s and failed to look it up: %w", missing.AuthEventID, err2)
|
||||||
}
|
}
|
||||||
util.GetLogger(ctx).Infof("fetched event %s", missing.AuthEventID)
|
util.GetLogger(ctx).Infof("fetched event %s", missing.AuthEventID)
|
||||||
@ -762,7 +775,12 @@ func (t *txnReq) lookupMissingStateViaStateIDs(ctx context.Context, roomID, even
|
|||||||
for missingEventID := range missing {
|
for missingEventID := range missing {
|
||||||
var h *gomatrixserverlib.HeaderedEvent
|
var h *gomatrixserverlib.HeaderedEvent
|
||||||
h, err = t.lookupEvent(ctx, roomVersion, missingEventID, false)
|
h, err = t.lookupEvent(ctx, roomVersion, missingEventID, false)
|
||||||
if err != nil {
|
switch err.(type) {
|
||||||
|
case verifySigError:
|
||||||
|
continue
|
||||||
|
case nil:
|
||||||
|
// do nothing
|
||||||
|
default:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
t.haveEvents[h.EventID()] = h
|
t.haveEvents[h.EventID()] = h
|
||||||
|
Loading…
Reference in New Issue
Block a user