Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
// AttCaches defines the caches used to satisfy attestation pool interface.
// These caches are KV store for various attestations
// such are unaggregated, aggregated or attestations within a block.
type AttCaches struct {
aggregatedAttLock sync.RWMutex
aggregatedAtt map[[32]byte][]*ethpb.Attestation
unAggregateAttLock sync.RWMutex
}
why use a slice type as the aggregatedAtt map's value? which sence the value may be slice?
the aggregatedAtt is the cache for store the aggregated attestation, key is the attestation's hash root,value is the aggregated result. i consider that the aggregated of multi attestations with the same hashRoot should one attestation, not a slice .
some related code is here:
beacon-chain/operations/attestations/kv/aggregated.go
// SaveAggregatedAttestation saves an aggregated attestation in cache.
func (c *AttCaches) SaveAggregatedAttestation(att *ethpb.Attestation) error
atts, ok := c.aggregatedAtt[r]
if !ok {
atts := []*ethpb.Attestation{copiedAtt}
c.aggregatedAtt[r] = atts
return nil
}
func Aggregate(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error) { ----> return value isslice
return MaxCoverAttestationAggregation(atts)
}
Can anyone answer my doubts? tks
Beta Was this translation helpful? Give feedback.
All reactions