You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
This patch implements the Built-in Reward Share feature which lets the
network itself to distribute the relay/block rewards into multiple
addresses. The change consists of the following parts.
- Add `RewardDelegators` in `Validator`
- Add `RewardDelegators` in `MsgStake`
- Add a new command `pocket nodes stakeNew`
- Distributes the fee of claim/proof transaction to a node's operator
address
- Add a new config `prevent_negative_reward_claim` not to claim a
potential loss evidence.
This change is consensus-breaking. The new behavior is put behind a new
feature key `RewardDelegator`. The new field is kept unavailable until
activation.
The new structure of `Validator` or `MsgStake` is backward/forward
compatible, meaning the new binary can still unmarshal data marshaled by
an older binary, and vice versa. In other words, the network before
`RewardDelegator` activation accepts an `MsgStake` transaction, ignoring
the `RewardDelegators` field. And the new `Validator` structure can
handle all historical states from genesis. Therefore this patch does not
introduce a structure like `10.0Validaor` as the NCUST patch did before.
<!-- reviewpad:summarize:start -->
### Summary generated by Reviewpad on 26 Dec 23 01:21 UTC
This pull request includes changes to multiple files. Here is a summary
of the diff:
1. The file `common_test.go` was modified to replace the import of
`math/rand` with `crypto/rand`. Additionally, the comment `// : deadcode
unused` was removed.
2. The file `x/nodes/keeper/abci_test.go` was modified to add and remove
import statements, as well as comment out unnecessary code related to
state conversion.
3. The file `x/nodes/types/validator.go` was modified to add an import,
add a new field to the `Validator` struct, add a new function to create
a validator from a message, modify several methods to include a new
field in the output, and add a new struct and comment.
4. The file `x/nodes/types/validator_test.go` was modified to add import
statements and a new test function.
5. The file `msg_test.go` was modified to add and remove import
statements, add new test functions, and update existing test functions.
6. The file `keeper_test.go` was modified to add import statements,
modify existing test functions, and add new test functions.
7. The file `go.mod` was modified to add and update package
requirements.
8. The file `handler.go` was modified to add import statements and
modify function implementations.
9. The file `nodes.proto` was modified to remove an import statement and
add a new field to a message.
10. The file `msg.go` was modified to add import statements, add a new
struct and function, and modify existing methods.
11. The file `genesis_test.go` was modified to add import statements and
modify existing test functions.
12. The file `rpc_test.go` was modified to add and remove import
statements, modify function implementations, and add test cases.
13. The file `expectedKeepers.go` was modified to remove comments and
add a new method.
14. The file `config.go` was modified to add a new field to a struct.
15. The file `msg.proto` was modified to add a new field to a message.
16. The file `LegacyValidator.go` was modified to add a new method and
update existing methods.
17. The file `errors.go` was modified to add new error codes and
functions to handle them.
18. The file `reward_test.go` was modified to add import statements, add
and update test functions.
19. The file `util_test.go` was modified to rearrange import statements
and add new test functions.
Please review these changes and provide any necessary feedback. Let me
know if you need more information or if there's anything else I can
assist you with.
<!-- reviewpad:summarize:end -->
---------
Co-authored-by: tokikuch <[email protected]>
ctx.Logger().Error(fmt.Sprintf("unable to send %s cut of block reward to the proposer: %s, with error %s, at height %d", proposerCut.String(), previousProposer, types.ErrNoValidatorForAddress(types.ModuleName), ctx.BlockHeight()))
250
+
ctx.Logger().Error("unable to find a validator to send a block reward to",
ctx.Logger().Error("unable to send a cut of block reward",
275
+
"height", ctx.BlockHeight(),
276
+
"cut", share,
277
+
"addr", recipient,
278
+
"err", err.Error(),
279
+
)
280
+
}
281
+
},
282
+
)
127
283
iferr!=nil {
128
-
ctx.Logger().Error(fmt.Sprintf("unable to send %s cut of block reward to the proposer: %s, with error %s, at height %d", proposerCut.String(), previousProposer, err.Error(), ctx.BlockHeight()))
284
+
ctx.Logger().Error("unable to split block rewards",
ctx.Logger().Error(fmt.Sprintf("unable to send %s cut of block reward to the proposer: %s, with error %s, at height %d", proposerCut.String(), previousProposer, err.Error(), ctx.BlockHeight()))
0 commit comments