-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Relay Mining] Foundation for integration test helpers + start integr…
…ating Relay Mining into EndBlocker (#571) **Core changes:** - Calling `UpdateRelayMiningDifficulty` in the `tokenomics` EndBlockers - Introduce the infra & helpers for integration tests to be used heavily in the next PRs - Capture & return a `ServiceToRelayCount` map when settling claims **Misc changes:** - Started moving some fixture generation helpers into a shared package - Minor Makefile cleanup - Reoder some imports - Rename s/errorsmod/sdkerrors **Up next:** - Update SMT to store the number of leaves/relays (not just compute units) - Full integration tests + E2E tests - Emit events - Update our grafana dashhboards to see how difficulty looks next to resource usage - Integrate with stress testing Co-authored-by: Bryan White <[email protected]>
- Loading branch information
1 parent
32c238a
commit 58d0abd
Showing
35 changed files
with
1,030 additions
and
159 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
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
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
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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
package tx | ||
|
||
import errorsmod "cosmossdk.io/errors" | ||
import sdkerrors "cosmossdk.io/errors" | ||
|
||
var ( | ||
// ErrInvalidMsg signifies that there was an issue in validating the | ||
// transaction message. This could be due to format, content, or other | ||
// constraints imposed on the message. | ||
ErrInvalidMsg = errorsmod.Register(codespace, 4, "failed to validate tx message") | ||
ErrInvalidMsg = sdkerrors.Register(codespace, 4, "failed to validate tx message") | ||
|
||
// ErrCheckTx indicates an error occurred during the ABCI check transaction | ||
// process, which verifies the transaction's integrity before it is added | ||
// to the mempool. | ||
ErrCheckTx = errorsmod.Register(codespace, 5, "error during ABCI check tx") | ||
ErrCheckTx = sdkerrors.Register(codespace, 5, "error during ABCI check tx") | ||
|
||
// ErrTxTimeout is raised when a transaction has taken too long to | ||
// complete, surpassing a predefined threshold. | ||
ErrTxTimeout = errorsmod.Register(codespace, 6, "tx timed out") | ||
ErrTxTimeout = sdkerrors.Register(codespace, 6, "tx timed out") | ||
|
||
// ErrQueryTx indicates an error occurred while trying to query for the status | ||
// of a specific transaction, likely due to issues with the query parameters | ||
// or the state of the blockchain network. | ||
ErrQueryTx = errorsmod.Register(codespace, 7, "error encountered while querying for tx") | ||
ErrQueryTx = sdkerrors.Register(codespace, 7, "error encountered while querying for tx") | ||
|
||
// ErrInvalidTxHash represents an error which is triggered when the | ||
// transaction hash provided does not adhere to the expected format or | ||
// constraints, implying it may be corrupted or tampered with. | ||
ErrInvalidTxHash = errorsmod.Register(codespace, 8, "invalid tx hash") | ||
ErrInvalidTxHash = sdkerrors.Register(codespace, 8, "invalid tx hash") | ||
|
||
// ErrNonTxEventBytes indicates an attempt to deserialize bytes that do not | ||
// correspond to a transaction event. This error is triggered when the provided | ||
// byte data isn't recognized as a valid transaction event representation. | ||
ErrNonTxEventBytes = errorsmod.Register(codespace, 9, "attempted to deserialize non-tx event bytes") | ||
ErrNonTxEventBytes = sdkerrors.Register(codespace, 9, "attempted to deserialize non-tx event bytes") | ||
|
||
// ErrUnmarshalTx signals a failure in the unmarshaling process of a transaction. | ||
// This error is triggered when the system encounters issues translating a set of | ||
// bytes into the corresponding Tx structure or object. | ||
ErrUnmarshalTx = errorsmod.Register(codespace, 10, "failed to unmarshal tx") | ||
ErrUnmarshalTx = sdkerrors.Register(codespace, 10, "failed to unmarshal tx") | ||
|
||
codespace = "tx_client" | ||
) |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package observable | ||
|
||
import errorsmod "cosmossdk.io/errors" | ||
import sdkerrors "cosmossdk.io/errors" | ||
|
||
var ( | ||
ErrObserverClosed = errorsmod.Register(codespace, 1, "observer is closed") | ||
ErrObserverClosed = sdkerrors.Register(codespace, 1, "observer is closed") | ||
codespace = "observable" | ||
) |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package protocol | ||
|
||
import errorsmod "cosmossdk.io/errors" | ||
import sdkerrors "cosmossdk.io/errors" | ||
|
||
var ( | ||
ErrDifficulty = errorsmod.New(codespace, 1, "difficulty error") | ||
ErrDifficulty = sdkerrors.New(codespace, 1, "difficulty error") | ||
codespace = "relayer/protocol" | ||
) |
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
23 changes: 23 additions & 0 deletions
23
tests/integration/tokenomics/relay_mining_difficulty_test.go
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,23 @@ | ||
package integration_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/pokt-network/poktroll/cmd/poktrolld/cmd" | ||
) | ||
|
||
// TODO_UPNEXT(@Olshansk, #571): Implement these tests | ||
|
||
func init() { | ||
cmd.InitSDKConfig() | ||
} | ||
|
||
func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) {} | ||
|
||
func UpdateRelayMiningDifficulty_UpdatingMultipleServicesAtOnce(t *testing.T) {} | ||
|
||
func UpdateRelayMiningDifficulty_UpdateServiceIsNotSeenForAWhile(t *testing.T) {} | ||
|
||
func UpdateRelayMiningDifficulty_UpdateServiceIsIncreasing(t *testing.T) {} | ||
|
||
func UpdateRelayMiningDifficulty_UpdateServiceIsDecreasing(t *testing.T) {} |
Oops, something went wrong.