diff --git a/x/emissions/keeper/keeper_test.go b/x/emissions/keeper/keeper_test.go index f1fb2317e..97a67627a 100644 --- a/x/emissions/keeper/keeper_test.go +++ b/x/emissions/keeper/keeper_test.go @@ -1456,7 +1456,6 @@ func (s *KeeperTestSuite) TestSetParams() { params := types.Params{ Version: "v1.0.0", - RewardCadence: 60 * 60 * 24 * 7 * 24, MinTopicWeight: alloraMath.NewDecFromInt64(100), MaxTopicsPerBlock: 1000, MaxMissingInferencePercent: alloraMath.NewDecFromInt64(10), @@ -1502,7 +1501,6 @@ func (s *KeeperTestSuite) TestSetParams() { paramsFromKeeper, err := keeper.GetParams(ctx) s.Require().NoError(err) s.Require().Equal(params.Version, paramsFromKeeper.Version, "Params should be equal to the set params: Version") - s.Require().Equal(params.RewardCadence, paramsFromKeeper.RewardCadence, "Params should be equal to the set params: EpochLength") s.Require().True(params.MinTopicWeight.Equal(paramsFromKeeper.MinTopicWeight), "Params should be equal to the set params: MinTopicWeight") s.Require().Equal(params.MaxTopicsPerBlock, paramsFromKeeper.MaxTopicsPerBlock, "Params should be equal to the set params: MaxTopicsPerBlock") s.Require().Equal(params.MaxMissingInferencePercent, paramsFromKeeper.MaxMissingInferencePercent, "Params should be equal to the set params: MaxMissingInferencePercent") diff --git a/x/emissions/keeper/msgserver/msg_server_params.go b/x/emissions/keeper/msgserver/msg_server_params.go index 578e2352a..8794bea75 100644 --- a/x/emissions/keeper/msgserver/msg_server_params.go +++ b/x/emissions/keeper/msgserver/msg_server_params.go @@ -28,9 +28,6 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams if len(newParams.Version) == 1 { existingParams.Version = newParams.Version[0] } - if len(newParams.RewardCadence) == 1 { - existingParams.RewardCadence = newParams.RewardCadence[0] - } if len(newParams.MinTopicWeight) == 1 { existingParams.MinTopicWeight = newParams.MinTopicWeight[0] } diff --git a/x/emissions/keeper/msgserver/msg_server_params_test.go b/x/emissions/keeper/msgserver/msg_server_params_test.go index 2cc02f4a3..c266f51c0 100644 --- a/x/emissions/keeper/msgserver/msg_server_params_test.go +++ b/x/emissions/keeper/msgserver/msg_server_params_test.go @@ -42,7 +42,6 @@ func (s *KeeperTestSuite) TestUpdateParams() { require.Equal(uint64(20), updatedParams.MaxTopicsPerBlock) require.Equal(existingParams.Version, updatedParams.Version) - require.Equal(existingParams.RewardCadence, updatedParams.RewardCadence) } func (s *KeeperTestSuite) TestUpdateAllParams() { @@ -57,7 +56,6 @@ func (s *KeeperTestSuite) TestUpdateAllParams() { newParams := &types.OptionalParams{ Version: []string{"1234"}, - RewardCadence: []int64{1234}, MinTopicWeight: []alloraMath.Dec{alloraMath.NewDecFromInt64(1234)}, MaxTopicsPerBlock: []uint64{1234}, MaxMissingInferencePercent: []alloraMath.Dec{alloraMath.NewDecFromInt64(1234)}, @@ -110,7 +108,6 @@ func (s *KeeperTestSuite) TestUpdateAllParams() { require.NoError(err) require.Equal(newParams.Version[0], updatedParams.Version) - require.Equal(newParams.RewardCadence[0], updatedParams.RewardCadence) require.Equal(newParams.MinTopicWeight[0], updatedParams.MinTopicWeight) require.Equal(newParams.MaxTopicsPerBlock[0], updatedParams.MaxTopicsPerBlock) require.Equal(newParams.MaxMissingInferencePercent[0], updatedParams.MaxMissingInferencePercent) diff --git a/x/emissions/keeper/queryserver/query_server_params_test.go b/x/emissions/keeper/queryserver/query_server_params_test.go index 5b7b9f27f..31a69b805 100644 --- a/x/emissions/keeper/queryserver/query_server_params_test.go +++ b/x/emissions/keeper/queryserver/query_server_params_test.go @@ -8,8 +8,7 @@ func (s *KeeperTestSuite) TestParams() { queryServer := s.queryServer expectedParams := types.Params{ - Version: "1.0", - RewardCadence: 86400, + Version: "1.0", } err := keeper.SetParams(ctx, expectedParams) @@ -20,5 +19,4 @@ func (s *KeeperTestSuite) TestParams() { s.Require().NoError(err, "Retrieving parameters should not produce an error") s.Require().NotNil(response, "The response should not be nil") s.Require().Equal(expectedParams.Version, response.Params.Version) - s.Require().Equal(expectedParams.RewardCadence, response.Params.RewardCadence) } diff --git a/x/emissions/module/rewards/topic_skimming_test.go b/x/emissions/module/rewards/topic_skimming_test.go index 4ec5e8ef0..3541a2903 100644 --- a/x/emissions/module/rewards/topic_skimming_test.go +++ b/x/emissions/module/rewards/topic_skimming_test.go @@ -11,7 +11,6 @@ import ( func (s *RewardsTestSuite) UtilSetParams() { s.emissionsKeeper.SetParams(s.ctx, types.Params{ Version: "0.0.3", - RewardCadence: int64(5), MinTopicWeight: alloraMath.NewDecFromInt64(100), MaxTopicsPerBlock: uint64(1000), MaxMissingInferencePercent: alloraMath.MustNewDecFromString("0.1"), diff --git a/x/emissions/proto/emissions/v1/params.proto b/x/emissions/proto/emissions/v1/params.proto index ee66bc073..0c92cf9c2 100644 --- a/x/emissions/proto/emissions/v1/params.proto +++ b/x/emissions/proto/emissions/v1/params.proto @@ -9,8 +9,8 @@ import "gogoproto/gogo.proto"; // Params defines the parameters of the module. message Params { - string version = 1; // version of the protocol should be in lockstep with github release tag version - int64 reward_cadence = 2; // length of an "epoch" for rewards payouts in blocks + string version = 1; // version of the protocol should be in lockstep with github release tag version + int64 max_serialized_msg_length = 2; // max length of input data for msg and query server calls string min_topic_weight = 3 [ (gogoproto.customtype) = "github.com/allora-network/allora-chain/math.Dec", (gogoproto.nullable) = false @@ -117,5 +117,4 @@ message Params { uint64 max_limit = 37; // max limit for pagination int64 min_epoch_length_record_limit = 38; // min number of epochs to keep network losses, reputer losses, inferences, forecasts - int64 max_serialized_msg_length = 39; // max length of input data for msg and query server calls } diff --git a/x/emissions/proto/emissions/v1/tx.proto b/x/emissions/proto/emissions/v1/tx.proto index 6254f1a0d..382a49189 100644 --- a/x/emissions/proto/emissions/v1/tx.proto +++ b/x/emissions/proto/emissions/v1/tx.proto @@ -59,7 +59,7 @@ service Msg { // same as if the field was not set message OptionalParams { repeated string version = 1; - repeated int64 reward_cadence = 2; + repeated int64 max_serialized_msg_length = 2; repeated string min_topic_weight = 3 [(gogoproto.customtype) = "github.com/allora-network/allora-chain/math.Dec", (gogoproto.nullable) = false]; repeated uint64 max_topics_per_block = 4; @@ -128,7 +128,6 @@ message OptionalParams { repeated uint64 default_limit = 36; repeated uint64 max_limit = 37; repeated int64 min_epoch_length_record_limit = 38; - repeated int64 max_serialized_msg_length = 39; } message MsgUpdateParams { diff --git a/x/emissions/types/params.go b/x/emissions/types/params.go index 2e62bffc8..c0cde2cf2 100644 --- a/x/emissions/types/params.go +++ b/x/emissions/types/params.go @@ -11,7 +11,6 @@ type BlockHeight = int64 func DefaultParams() Params { return Params{ Version: "0.0.3", // version of the protocol should be in lockstep with github release tag version - RewardCadence: int64(1), // length of an "epoch" for rewards payouts in blocks; coupled with TopicRewardAlpha MinTopicWeight: alloraMath.MustNewDecFromString("100"), // total weight for a topic < this => don't run inference solicatation or loss update MaxTopicsPerBlock: uint64(128), // max number of topics to run cadence for per block MaxMissingInferencePercent: alloraMath.MustNewDecFromString("0.2"), // if a worker has this percentage of inferences missing, they are penalized @@ -31,7 +30,7 @@ func DefaultParams() Params { MaxUnfulfilledReputerRequests: uint64(100), // maximum number of outstanding nonces for reputer requests per topic from the chain TopicRewardStakeImportance: alloraMath.MustNewDecFromString("0.5"), // importance of stake in determining rewards for a topic TopicRewardFeeRevenueImportance: alloraMath.MustNewDecFromString("0.5"), // importance of fee revenue in determining rewards for a topic - TopicRewardAlpha: alloraMath.MustNewDecFromString("0.5"), // alpha for topic reward calculation; coupled with RewardCadence + TopicRewardAlpha: alloraMath.MustNewDecFromString("0.5"), // alpha for topic reward calculation; coupled with blocktime, or how often rewards are calculated TaskRewardAlpha: alloraMath.MustNewDecFromString("0.1"), // alpha for task reward calculation used to calculate ~U_ij, ~V_ik, ~W_im ValidatorsVsAlloraPercentReward: alloraMath.MustNewDecFromString("0.25"), // 25% rewards go to cosmos network validators MaxSamplesToScaleScores: uint64(10), // maximum number of previous scores to store and use for standard deviation calculation @@ -56,10 +55,6 @@ func DefaultParamsVersion() string { return DefaultParams().Version } -func DefaultParamsEpochLength() BlockHeight { - return DefaultParams().RewardCadence -} - func DefaultParamsMinTopicUnmetDemand() alloraMath.Dec { return DefaultParams().MinTopicWeight }