prysm-pulse/beacon-chain/db/kv/key.go
Radosław Kapka cafe0bd1f8
Capella beacon state (#11141)
* fork

* types

* cloners

* getters

* remove CapellaBlind from fork

* hasher

* setters

* spec params, config tests

* generate ssz

* executionPayloadHeaderCapella

* proto state

* BeaconStateCapella SSZ

* saving state

* configfork

* BUILD files

* fix RealPosition

* fix hasher

* SetLatestExecutionPayloadHeaderCapella

* fix error message

* reduce complexity of saveStatesEfficientInternal

* add latestExecutionPayloadHeaderCapella to minimal state

* halway done interface

* remove withdrawal methods

* merge setters

* change signatures for v1 and v2

* fixing errors pt. 1

* paylod_test fixes

* fix everything

* remove unused func

* fix tests

* state_trie_test improvements

* in progress...

* hasher test

* fix configs

* simplify hashing

* Revert "fix configs"

This reverts commit bcae2825fcc8ba45a2b43d68ad0ab57f8eac8952.

* remove capella from config test

* unify locking

* review

* hashing

* fixes

Co-authored-by: terencechain <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2022-10-12 11:39:19 -05:00

33 lines
741 B
Go

package kv
import "bytes"
// In order for an encoding to be Altair compatible, it must be prefixed with altair key.
func hasAltairKey(enc []byte) bool {
if len(altairKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(altairKey)], altairKey)
}
func hasBellatrixKey(enc []byte) bool {
if len(bellatrixKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(bellatrixKey)], bellatrixKey)
}
func hasBellatrixBlindKey(enc []byte) bool {
if len(bellatrixBlindKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(bellatrixBlindKey)], bellatrixBlindKey)
}
func hasCapellaKey(enc []byte) bool {
if len(capellaKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(capellaKey)], capellaKey)
}