Skip to content

Commit

Permalink
feat(logic): add default_predicate_cost parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Apr 3, 2023
1 parent 7fe989f commit 52eac51
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions proto/logic/v1beta2/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,28 @@ message Interpreter {
}

// GasPolicy defines the policy for calculating predicate invocation costs and the resulting gas consumption.
// The gas policy is defined as a list of predicates and their associated unit costs, a default unit cost for predicates
// if not specified in the list, and a weighting factor that is applied to the unit cost of each predicate to yield.
message GasPolicy {
// WeightingFactor is the factor that is applied to the unit cost of each predicate
// to yield the gas value.
// If not provided or set to 0, the default value of 1 is used.
// If not provided or set to 0, the value is set to 1.
string weighting_factor = 1 [
(gogoproto.moretags) = "yaml:\"weighting_factor\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint",
(gogoproto.nullable) = true
];

// DefaultPredicateCost is the default unit cost of a predicate when not specified in the PredicateCosts list.
// If not provided or set to 0, the value is set to 1.
string default_predicate_cost = 2 [
(gogoproto.moretags) = "yaml:\"default_predicate_cost\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint",
(gogoproto.nullable) = true
];

// PredicateCosts is the list of predicates and their associated unit costs.
// If not provided, all predicates have a unit cost of 1 by default.
repeated PredicateCost predicate_costs = 2 [
repeated PredicateCost predicate_costs = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"predicate_cost\""
];
Expand Down

0 comments on commit 52eac51

Please sign in to comment.