Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// version a string since it is overwritten at build-time with the git tag for official releases.
var version = "v1.6"
var version = "v1.6-rc"

// Version is the branch version of the codebase.
// - Main branch: v0.X-dev
Expand Down
25 changes: 23 additions & 2 deletions core/dutydb/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,29 @@ func (db *MemDB) storeAttestationUnsafe(pubkey core.PubKey, unsignedData core.Un
}

if value, ok := db.attDuties[aKeyCommIdx0]; ok {
if value.String() != attData.Data.String() {
return errors.New("clashing attestation data", z.Any("key", aKeyCommIdx0))
// When we fetch attestation data with the fetcher, we are doing this in a loop,
// which takes variable amount of time, based on the beacon node's performance.
// If the beacon node is underperforming it might be that in the middle of this loop it receives a new block.
// This will result some attestation datas having the up to date head, while others have an old head.
// In a good scenario of well performing beacon node, the heads will be the same and the `value`` and `attData.Data`
// will be equal. However, in the scenario explained above, their head will missmatch, resulting in inequality.
// That's why we are checking here only if source and target missmatch.
if value.Source.String() != attData.Data.Source.String() {
return errors.New(
"clashing attestation data with hardcoded commidx=0 source",
z.Any("key", aKeyCommIdx0),
z.Str("existing", value.Source.String()),
z.Str("new", attData.Data.Source.String()),
)
}

if value.Target.String() != attData.Data.Target.String() {
return errors.New(
"clashing attestation data with hardcoded commidx=0 target",
z.Any("key", aKeyCommIdx0),
z.Str("existing", value.Target.String()),
z.Str("new", attData.Data.Target.String()),
)
}
} else {
db.attDuties[aKeyCommIdx0] = &attData.Data
Expand Down
2 changes: 2 additions & 0 deletions p2p/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func SendReceive(ctx context.Context, p2pNode host.Host, peerID peer.ID,
log.Debug(ctx, "Closing canceled stream", z.Err(err), z.Any("protocol", s.Protocol()))
return nil
}

return errors.Wrap(err, "close stream", z.Any("protocol", s.Protocol()))
}

Expand Down Expand Up @@ -367,6 +368,7 @@ func Send(ctx context.Context, p2pNode host.Host, protoID protocol.ID, peerID pe
log.Debug(ctx, "Closing canceled stream", z.Err(err), z.Any("protocol", s.Protocol()))
return nil
}

return errors.Wrap(err, "close stream", z.Any("protocol", s.Protocol()))
}

Expand Down
Loading