Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Service] Return the default RelayMinerDifficuly for services that have none. #926

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

red-0ne
Copy link
Contributor

@red-0ne red-0ne commented Nov 16, 2024

Summary

Make servicekeeper.GetRelayMinerDifficulty always return a valid difficulty by defaulting to the base difficulty for new Services.

Issue

Querying for a RelayMiningDifficulty corresponding to a new Service does not return a valid one.

This results in redundant code that aims to recreate the base RelayMiningDifficulty.

Type of change

Select one or more from the following:

Testing

  • Unit Tests: make go_develop_and_test
  • LocalNet E2E Tests: make test_e2e
  • DevNet E2E Tests: Add the devnet-test-e2e label to the PR.

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

@red-0ne red-0ne added service Anything related to general-purpose RPC service support code health Cleans up some code labels Nov 16, 2024
@red-0ne red-0ne added this to the Shannon Beta TestNet Launch milestone Nov 16, 2024
@red-0ne red-0ne self-assigned this Nov 16, 2024
x/service/keeper/relay_mining_difficulty.go Show resolved Hide resolved
@@ -20,6 +21,13 @@ var _ = strconv.IntSize
func TestRelayMiningDifficultyQuerySingle(t *testing.T) {
keeper, ctx := keepertest.ServiceKeeper(t)
msgs := createNRelayMiningDifficulty(keeper, ctx, 2)

// Add the corresponding services to the store to ensure that NotFound is returned
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great comment for this specific test.

Copy link

The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks.

You may need to run make trigger_ci to submit an empty commit that'll trigger the tests.

GCP workloads (requires changing the namespace to 926)
Grafana network dashboard for devnet-issue-926

@github-actions github-actions bot added devnet push-image CI related - pushes images to ghcr.io labels Nov 16, 2024
@red-0ne red-0ne merged commit 0bbefb9 into main Nov 16, 2024
11 checks passed
bryanchriswhite added a commit that referenced this pull request Nov 18, 2024
* todo_beta/upnext:
  [C&P] Populate NumEstimatedComputeUnits and ClaimedUpokt of Claim and Proof events (#927)
  [Tokenomics] feat: add `dao_reward_address` param to tokenomics module (#922)
  chore: review feedback improvements
  chore: review feedback improvements
  [Service] Return the default RelayMinerDifficuly for services that have none. (#926)
  [Upgrade] Alpha TestNet v0.0.10 upgrade (#894)
  Update reviewdog.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Cleans up some code devnet devnet-test-e2e push-image CI related - pushes images to ghcr.io service Anything related to general-purpose RPC service support
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants