Skip to content

Commit 7db1ccb

Browse files
Merge pull request #6515 from oasisprotocol/martin/trivial/migrate-feature-version-242-to-261
go: Rename feature version 242 to 261 release
2 parents 364bff9 + 8eee847 commit 7db1ccb

23 files changed

Lines changed: 86 additions & 86 deletions

File tree

.changelog/6514.trivial.md

Whitespace-only changes.

go/common/node/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ func HashRAK(rak signature.PublicKey) hash.Hash {
574574
}
575575

576576
// Verify verifies the node's TEE capabilities, at the provided timestamp and height.
577-
func (c *CapabilityTEE) Verify(teeCfg *TEEFeatures, ts time.Time, height uint64, constraints []byte, nodeID signature.PublicKey, isFeatureVersion242 bool) error {
577+
func (c *CapabilityTEE) Verify(teeCfg *TEEFeatures, ts time.Time, height uint64, constraints []byte, nodeID signature.PublicKey, isFeatureVersion261 bool) error {
578578
switch c.Hardware {
579579
case TEEHardwareIntelSGX:
580580
// Parse SGX remote attestation.
@@ -591,7 +591,7 @@ func (c *CapabilityTEE) Verify(teeCfg *TEEFeatures, ts time.Time, height uint64,
591591
if err := cbor.Unmarshal(constraints, &sc); err != nil {
592592
return fmt.Errorf("node: malformed SGX constraints: %w", err)
593593
}
594-
if err := sc.ValidateBasic(teeCfg, isFeatureVersion242); err != nil {
594+
if err := sc.ValidateBasic(teeCfg, isFeatureVersion261); err != nil {
595595
return fmt.Errorf("node: malformed SGX constraints: %w", err)
596596
}
597597

go/common/node/sgx.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (sc *SGXConstraints) MarshalCBOR() ([]byte, error) {
9797
}
9898

9999
// ValidateBasic performs basic structure validity checks.
100-
func (sc *SGXConstraints) ValidateBasic(cfg *TEEFeatures, isFeatureVersion242 bool) error {
100+
func (sc *SGXConstraints) ValidateBasic(cfg *TEEFeatures, isFeatureVersion261 bool) error {
101101
if cfg == nil {
102102
cfg = &emptyFeatures
103103
}
@@ -121,7 +121,7 @@ func (sc *SGXConstraints) ValidateBasic(cfg *TEEFeatures, isFeatureVersion242 bo
121121
}
122122

123123
// Check that policy is compliant with the current feature version.
124-
if err := sc.Policy.Validate(isFeatureVersion242); err != nil {
124+
if err := sc.Policy.Validate(isFeatureVersion261); err != nil {
125125
return fmt.Errorf("invalid policy: %w", err)
126126
}
127127

go/common/sgx/quote/quote.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ type Policy struct {
6666
}
6767

6868
// Validate validates the policy.
69-
func (p *Policy) Validate(isFeatureVersion242 bool) error {
70-
if isFeatureVersion242 {
69+
func (p *Policy) Validate(isFeatureVersion261 bool) error {
70+
if isFeatureVersion261 {
7171
return nil
7272
}
7373

go/consensus/cometbft/apps/keymanager/churp/txs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ func resetHandoff(status *churp.Status, nextHandoff beacon.EpochTime) {
559559
}
560560

561561
func verifyPolicy(ctx *tmapi.Context, policy *churp.SignedPolicySGX) error {
562-
// Allow non-empty `MayQuery` field with the 24.2 release.
563-
enabled, err := features.IsFeatureVersion(ctx, migrations.Version242)
562+
// Allow non-empty `MayQuery` field with the 26.1 feature version enabled.
563+
enabled, err := features.IsFeatureVersion(ctx, migrations.Version261)
564564
if err != nil {
565565
return err
566566
}

go/consensus/cometbft/apps/keymanager/common/genesis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func RegistryRuntimes(ctx *tmapi.Context, doc *genesis.Document, epoch beacon.Ep
1616
regSt := doc.Registry
1717
rtMap := make(map[common.Namespace]*registry.Runtime)
1818
for _, rt := range regSt.Runtimes {
19-
verifyOpts := registry.VerifyRuntimeOptions{IsGenesis: true, IsFeatureVersion242: true}
19+
verifyOpts := registry.VerifyRuntimeOptions{IsGenesis: true, IsFeatureVersion261: true}
2020
err := registry.VerifyRuntime(&regSt.Parameters, ctx.Logger(), rt, epoch, verifyOpts)
2121
if err != nil {
2222
ctx.Logger().Error("InitChain: Invalid runtime",

go/consensus/cometbft/apps/keymanager/secrets/epoch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (ext *secretsExt) onEpochChange(ctx *tmapi.Context, epoch beacon.EpochTime)
2828
return fmt.Errorf("failed to get consensus parameters: %w", err)
2929
}
3030

31-
isFeatureVersion242, err := features.IsFeatureVersion(ctx, migrations.Version242)
31+
isFeatureVersion261, err := features.IsFeatureVersion(ctx, migrations.Version261)
3232
if err != nil {
3333
return err
3434
}
@@ -71,7 +71,7 @@ func (ext *secretsExt) onEpochChange(ctx *tmapi.Context, epoch beacon.EpochTime)
7171
return fmt.Errorf("failed to query key manager master secret: %w", err)
7272
}
7373

74-
newStatus := generateStatus(ctx, rt, oldStatus, secret, nodes, params, epoch, isFeatureVersion242)
74+
newStatus := generateStatus(ctx, rt, oldStatus, secret, nodes, params, epoch, isFeatureVersion261)
7575
if forceEmit || !bytes.Equal(cbor.Marshal(oldStatus), cbor.Marshal(newStatus)) {
7676
ctx.Logger().Debug("status updated",
7777
"id", newStatus.ID,

go/consensus/cometbft/apps/keymanager/secrets/status.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func generateStatus( // nolint: gocyclo
3232
nodes []*node.Node,
3333
params *registry.ConsensusParameters,
3434
epoch beacon.EpochTime,
35-
isFeatureVersion242 bool,
35+
isFeatureVersion261 bool,
3636
) *secrets.Status {
3737
status := &secrets.Status{
3838
ID: kmrt.ID,
@@ -112,7 +112,7 @@ nextNode:
112112
continue nextNode
113113
}
114114

115-
initResponse, err := VerifyExtraInfo(ctx.Logger(), n.ID, kmrt, nodeRt, ts, height, params, isFeatureVersion242)
115+
initResponse, err := VerifyExtraInfo(ctx.Logger(), n.ID, kmrt, nodeRt, ts, height, params, isFeatureVersion261)
116116
if err != nil {
117117
ctx.Logger().Error("failed to validate ExtraInfo", append(vars, "err", err)...)
118118
continue nextNode
@@ -232,9 +232,9 @@ func VerifyExtraInfo(
232232
ts time.Time,
233233
height uint64,
234234
params *registry.ConsensusParameters,
235-
isFeatureVersion242 bool,
235+
isFeatureVersion261 bool,
236236
) (*secrets.InitResponse, error) {
237-
if err := registry.VerifyNodeRuntimeEnclaveIDs(logger, nodeID, nodeRt, rt, params.TEEFeatures, ts, height, isFeatureVersion242); err != nil {
237+
if err := registry.VerifyNodeRuntimeEnclaveIDs(logger, nodeID, nodeRt, rt, params.TEEFeatures, ts, height, isFeatureVersion261); err != nil {
238238
return nil, err
239239
}
240240
if nodeRt.ExtraInfo == nil {

go/consensus/cometbft/apps/keymanager/secrets/txs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ func (ext *secretsExt) updatePolicy(
7676
status.NextPolicy = sigPol
7777

7878
// Support legacy behavior where the policy was applied immediately.
79-
isFeatureVersion242, err := features.IsFeatureVersion(ctx, migrations.Version242)
79+
isFeatureVersion261, err := features.IsFeatureVersion(ctx, migrations.Version261)
8080
if err != nil {
8181
return err
8282
}
83-
if !isFeatureVersion242 {
83+
if !isFeatureVersion261 {
8484
// Ok, as far as we can tell the new policy is valid, apply it.
8585
//
8686
// Note: The key manager cohort responsible for servicing this ID
@@ -104,7 +104,7 @@ func (ext *secretsExt) updatePolicy(
104104

105105
nodes, _ := regState.Nodes(ctx)
106106
registry.SortNodeList(nodes)
107-
status = generateStatus(ctx, kmRt, status, nil, nodes, regParams, epoch, isFeatureVersion242)
107+
status = generateStatus(ctx, kmRt, status, nil, nodes, regParams, epoch, isFeatureVersion261)
108108
}
109109

110110
if err := state.SetStatus(ctx, status); err != nil {

go/consensus/cometbft/apps/registry/genesis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (app *Application) InitChain(ctx *abciAPI.Context, _ types.RequestInitChain
5555
if rt == nil {
5656
return fmt.Errorf("registry: genesis runtime index %d is nil", i)
5757
}
58-
verifyOpts := registry.VerifyRuntimeOptions{IsGenesis: ctx.IsInitChain(), IsFeatureVersion242: true}
58+
verifyOpts := registry.VerifyRuntimeOptions{IsGenesis: ctx.IsInitChain(), IsFeatureVersion261: true}
5959
err := registry.VerifyRuntime(&st.Parameters, ctx.Logger(), rt, epoch, verifyOpts)
6060
if err != nil {
6161
return err

0 commit comments

Comments
 (0)