@@ -1101,21 +1101,29 @@ func VerifyNodeUpdate(
11011101 return nil
11021102}
11031103
1104+ // VerifyRuntimeOptions contains the options for VerifyRuntime.
1105+ type VerifyRuntimeOptions struct {
1106+ // IsGenesis is true if the runtime is being verified during genesis.
1107+ IsGenesis bool
1108+ // IsSanityCheck is true if this is a sanity check and not a live transaction verification.
1109+ IsSanityCheck bool
1110+ // IsFeatureVersion242 is true if consensus version 24.2 or higher is active.
1111+ IsFeatureVersion242 bool
1112+ }
1113+
11041114// VerifyRuntime verifies the given runtime.
1105- func VerifyRuntime ( // nolint: gocyclo
1115+ func VerifyRuntime (
11061116 params * ConsensusParameters ,
11071117 logger * logging.Logger ,
11081118 rt * Runtime ,
1109- isGenesis bool ,
1110- isSanityCheck bool ,
11111119 now beacon.EpochTime ,
1112- isFeatureVersion242 bool ,
1120+ opts VerifyRuntimeOptions ,
11131121) error {
11141122 if rt == nil {
11151123 return fmt .Errorf ("%w: no runtime given" , ErrInvalidArgument )
11161124 }
11171125
1118- if err := rt .ValidateBasic (! isGenesis && ! isSanityCheck ); err != nil {
1126+ if err := rt .ValidateBasic (! opts . IsGenesis && ! opts . IsSanityCheck ); err != nil {
11191127 logger .Error ("RegisterRuntime: invalid runtime descriptor" ,
11201128 "runtime" , rt ,
11211129 "err" , err ,
@@ -1130,7 +1138,7 @@ func VerifyRuntime( // nolint: gocyclo
11301138 return fmt .Errorf ("%w: test runtime not allowed" , ErrInvalidArgument )
11311139 }
11321140
1133- if err := rt .Genesis .SanityCheck (isGenesis ); err != nil {
1141+ if err := rt .Genesis .SanityCheck (opts . IsGenesis ); err != nil {
11341142 return err
11351143 }
11361144
@@ -1154,7 +1162,7 @@ func VerifyRuntime( // nolint: gocyclo
11541162
11551163 // Validate the deployments. This also handles validating that the
11561164 // appropriate TEE configuration is present in each deployment.
1157- if err := rt .ValidateDeployments (now , params , isFeatureVersion242 ); err != nil {
1165+ if err := rt .ValidateDeployments (now , params , opts . IsFeatureVersion242 ); err != nil {
11581166 logger .Error ("RegisterRuntime: invalid deployments" ,
11591167 "runtime_id" , rt .ID ,
11601168 "err" , err ,
0 commit comments