@@ -131,13 +131,19 @@ func (f *GenesisForker) Fork(ctx context.Context, opts ports.ForkOptions, progre
131131 return nil , fmt .Errorf ("failed to apply patches: %w" , err )
132132 }
133133
134- // Apply plugin-specific patches
134+ // Apply plugin-specific patches (voting period, unbonding time, inflation rate, etc.)
135135 if f .config .PluginGenesis != nil {
136136 patched , err = f .config .PluginGenesis .PatchGenesis (patched , opts .PatchOpts )
137137 if err != nil {
138138 reportStep (progress , "Applying genesis patches" , "failed" , err .Error ())
139139 return nil , fmt .Errorf ("plugin patch failed: %w" , err )
140140 }
141+ } else if opts .PatchOpts .VotingPeriod > 0 || opts .PatchOpts .UnbondingTime > 0 || opts .PatchOpts .InflationRate != "" {
142+ f .logger .Warn ("genesis patch options specify network parameters but no plugin is configured to apply them" ,
143+ "votingPeriod" , opts .PatchOpts .VotingPeriod ,
144+ "unbondingTime" , opts .PatchOpts .UnbondingTime ,
145+ "inflationRate" , opts .PatchOpts .InflationRate ,
146+ )
141147 }
142148 reportStep (progress , "Applying genesis patches" , "completed" , "" )
143149
@@ -416,9 +422,11 @@ func (f *GenesisForker) fetchGenesisHTTP(ctx context.Context, url string) ([]byt
416422 return body , nil
417423}
418424
419- // applyPatches applies generic patches to genesis
425+ // applyPatches applies generic patches to genesis.
426+ // This only handles chain_id patching. Network-specific patches (voting period,
427+ // unbonding time, inflation rate) are handled by the plugin's PatchGenesis method.
420428func (f * GenesisForker ) applyPatches (genesis []byte , opts types.GenesisPatchOptions ) ([]byte , error ) {
421- if opts .ChainID == "" && opts . VotingPeriod == 0 && opts . UnbondingTime == 0 {
429+ if opts .ChainID == "" {
422430 return genesis , nil
423431 }
424432
@@ -427,10 +435,7 @@ func (f *GenesisForker) applyPatches(genesis []byte, opts types.GenesisPatchOpti
427435 return nil , fmt .Errorf ("failed to parse genesis: %w" , err )
428436 }
429437
430- // Patch chain_id
431- if opts .ChainID != "" {
432- gen ["chain_id" ] = opts .ChainID
433- }
438+ gen ["chain_id" ] = opts .ChainID
434439
435440 return json .MarshalIndent (gen , "" , " " )
436441}
0 commit comments