-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: epoched reward distribution part 2 - send
When fees are sent to vbank at the epoch, calculate a rate for distributing them to exhaust the reward pool by theend of the epoch.
- Loading branch information
Showing
10 changed files
with
1,106 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
syntax = "proto3"; | ||
package agoric.vbank; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
|
||
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank/types"; | ||
|
||
message Params { | ||
option (gogoproto.equal) = true; | ||
|
||
// feeEpochDurationBlocks is the length of a fee epoch, in blocks. | ||
// A value of zero has the same meaning as a value of one: | ||
// the full fee buffer should be distributed immediately. | ||
int64 feeEpochDurationBlocks = 1; | ||
} | ||
|
||
message State { | ||
option (gogoproto.equal) = true; | ||
|
||
// rewardPool is the current balance of rewards in the module account. | ||
// NOTE: Tracking manually since there is no bank call for getting a | ||
// module account balance by name. | ||
repeated cosmos.base.v1beta1.Coin rewardPool = 1 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; | ||
|
||
// rewardRate is the amount of reward, if available, to send to the | ||
// fee collector module on every block. | ||
repeated cosmos.base.v1beta1.Coin rewardRate = 2 | ||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; | ||
} |
40 changes: 40 additions & 0 deletions
40
golang/cosmos/third_party/proto/cosmos/base/v1beta1/coin.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
syntax = "proto3"; | ||
package cosmos.base.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/types"; | ||
option (gogoproto.goproto_stringer_all) = false; | ||
option (gogoproto.stringer_all) = false; | ||
|
||
// Coin defines a token with a denomination and an amount. | ||
// | ||
// NOTE: The amount field is an Int which implements the custom method | ||
// signatures required by gogoproto. | ||
message Coin { | ||
option (gogoproto.equal) = true; | ||
|
||
string denom = 1; | ||
string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// DecCoin defines a token with a denomination and a decimal amount. | ||
// | ||
// NOTE: The amount field is an Dec which implements the custom method | ||
// signatures required by gogoproto. | ||
message DecCoin { | ||
option (gogoproto.equal) = true; | ||
|
||
string denom = 1; | ||
string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// IntProto defines a Protobuf wrapper around an Int object. | ||
message IntProto { | ||
string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// DecProto defines a Protobuf wrapper around a Dec object. | ||
message DecProto { | ||
string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.