Skip to content

Commit

Permalink
chore(batching): remove validator set trimming parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega committed Nov 28, 2024
1 parent 74b8395 commit 323f115
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 390 deletions.
9 changes: 0 additions & 9 deletions proto/sedachain/batching/v1/batching.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ message BatchSignatures {
bytes secp256k1_signature = 2;
}

// Params is a list of parameters which can be changed through governance.
message Params {
option (gogoproto.equal) = true;

// validator_set_trim_percent is the percentage of the validator
// set to store in the validator merkle tree in the batch.
uint32 validator_set_trim_percent = 1;
}

// DataResult represents the result of a resolved data request.
message DataResult {
// id is the Keccack-256 hash of the data result.
Expand Down
1 change: 0 additions & 1 deletion proto/sedachain/batching/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ message GenesisState {
repeated DataResult data_results = 4 [ (gogoproto.nullable) = false ];
repeated BatchAssignment batch_assignments = 5
[ (gogoproto.nullable) = false ];
Params params = 6 [ (gogoproto.nullable) = false ];
}

// BatchAssignment represents a batch assignment for genesis export
Expand Down
9 changes: 1 addition & 8 deletions x/batching/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) {
}
}
}
if err := k.setParams(ctx, data.Params); err != nil {
panic(err)
}
}

// ExportGenesis extracts all data from store to genesis state.
Expand Down Expand Up @@ -62,9 +59,5 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) types.GenesisState {
}
batchData[i] = data
}
params, err := k.GetParams(ctx)
if err != nil {
panic(err)
}
return types.NewGenesisState(curBatchNum, batches, batchData, dataResults, batchAssignments, params)
return types.NewGenesisState(curBatchNum, batches, batchData, dataResults, batchAssignments)
}
2 changes: 0 additions & 2 deletions x/batching/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type Keeper struct {
validatorTreeEntries collections.Map[collections.Pair[uint64, []byte], types.ValidatorTreeEntry]
dataResultTreeEntries collections.Map[uint64, types.DataResultTreeEntries]
batchSignatures collections.Map[collections.Pair[uint64, []byte], types.BatchSignatures]
params collections.Item[types.Params]
}

func NewKeeper(
Expand Down Expand Up @@ -68,7 +67,6 @@ func NewKeeper(
validatorTreeEntries: collections.NewMap(sb, types.ValidatorTreeEntriesKeyPrefix, "validator_tree_entries", collections.PairKeyCodec(collections.Uint64Key, collections.BytesKey), codec.CollValue[types.ValidatorTreeEntry](cdc)),
dataResultTreeEntries: collections.NewMap(sb, types.DataResultTreeEntriesKeyPrefix, "data_result_tree_entries", collections.Uint64Key, codec.CollValue[types.DataResultTreeEntries](cdc)),
batchSignatures: collections.NewMap(sb, types.BatchSignaturesKeyPrefix, "batch_signatures", collections.PairKeyCodec(collections.Uint64Key, collections.BytesKey), codec.CollValue[types.BatchSignatures](cdc)),
params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
}

schema, err := sb.Build()
Expand Down
20 changes: 0 additions & 20 deletions x/batching/keeper/params.go

This file was deleted.

289 changes: 53 additions & 236 deletions x/batching/types/batching.pb.go

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions x/batching/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@ func NewGenesisState(
batchData []BatchData,
dataResults []DataResult,
batchAssignments []BatchAssignment,
params Params,
) GenesisState {
return GenesisState{
CurrentBatchNumber: curBatchNum,
Batches: batches,
BatchData: batchData,
DataResults: dataResults,
BatchAssignments: batchAssignments,
Params: params,
}
}

// DefaultGenesisState creates a default GenesisState object.
func DefaultGenesisState() *GenesisState {
state := NewGenesisState(collections.DefaultSequenceStart, nil, nil, nil, nil, DefaultParams())
state := NewGenesisState(collections.DefaultSequenceStart, nil, nil, nil, nil)
return &state
}

Expand Down
116 changes: 31 additions & 85 deletions x/batching/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions x/batching/types/params.go

This file was deleted.

0 comments on commit 323f115

Please sign in to comment.