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

[Quick PE] Fix test after lowering MinProofSubmissionFee #1051

Merged
merged 3 commits into from
Feb 1, 2025

Conversation

okdas
Copy link
Member

@okdas okdas commented Jan 31, 2025

Summary

Fixes the test after lowering MinProofSubmissionFee

Changes:

  • Changed session test from using params to using new ClamAndProofGasCost variable that accounts for both - claim and proof cost.

An example of failing test:

=== RUN   TestRelayerSessionsManager_ColdStartRelayMinerWithUnclaimedRelays
    session_test.go:40: TODO_TEST: Add a test case which simulates a cold-started relayminer with unclaimed relays.
--- SKIP: TestRelayerSessionsManager_ColdStartRelayMinerWithUnclaimedRelays (0.00s)
=== RUN   TestRelayerSessionsManager_ProofThresholdRequired
{"level":"debug","session_id":"","application":"","supplier_operator_address":"pokt1hqu76kexjyq33967vrecs2muc9t6kl7q566j6r","message":"added relay to session tree"}
{"level":"info","session_end_height":2,"claim_window_open_height":12,"message":"waiting & blocking until the earliest claim commit height offset seed block height"}
{"level":"info","session_end_height":2,"claim_window_open_height":12,"claim_window_open_block_hash":"0000000000000000000000000000000000000000000000000000000000000000","message":"observed earliest claim commit height offset seed block height"}
{"level":"info","session_end_height":2,"claim_window_open_height":12,"claim_window_open_block_hash":"0000000000000000000000000000000000000000000000000000000000000000","earliest_claim_commit_height":12,"message":"waiting & blocking until the earliest claim commit height for this supplier"}
{"level":"info","session_end_height":2,"claim_window_open_height":12,"claim_window_open_block_hash":"0000000000000000000000000000000000000000000000000000000000000000","earliest_claim_commit_height":12,"message":"observed earliest claim commit height"}
{"level":"info","store_path":"/var/folders/ll/pqw252v92119_v5k359g1gkc0000gn/T/TestRelayerSessionsManager_ProofThresholdRequired_smt_kvstore785910756/pokt1hqu76kexjyq33967vrecs2muc9t6kl7q566j6r","session_id":"","supplier_operator_address":"pokt1hqu76kexjyq33967vrecs2muc9t6kl7q566j6r","claim_root":"bcd4d8cd9b5bbd06db792825ec4b1e4158e4824365cb326e9a850b927532fa5e00000000000000020000000000000001","message":"KVStore is already stopped"}
{"level":"warn","supplier_operator_address":"pokt1hqu76kexjyq33967vrecs2muc9t6kl7q566j6r","session_id":"","supplier_operator_balance":"200upokt","proof_submission_fee":"50100upokt","message":"supplier operator cannot afford to submit proof for claim, deleting session tree"}
{"level":"warn","supplier_operator_address":"pokt1hqu76kexjyq33967vrecs2muc9t6kl7q566j6r","message":"Supplier operator \"pokt1hqu76kexjyq33967vrecs2muc9t6kl7q566j6r\" can only afford 0 out of 1 claims"}
panic: runtime error: index out of range [0] with length 0

goroutine 113 [running]:
github.com/pokt-network/poktroll/pkg/relayer/session.(*relayerSessionsManager).waitForEarliestSubmitProofsHeightAndGenerateProofs(0x0?, {0x10370f970?, 0x140016311a0?}, {0x1055461a0, 0x0, 0x0}, 0x1?)
        /Users/dk/pocket/poktroll-concurrent/pkg/relayer/session/proof.go:88 +0x588
github.com/pokt-network/poktroll/pkg/relayer/session.(*relayerSessionsManager).submitProofs.(*relayerSessionsManager).mapWaitForEarliestSubmitProofsHeight.func1({0x10370f970?, 0x140016311a0?}, {0x1055461a0?, 0x0?, 0x0?})
        /Users/dk/pocket/poktroll-concurrent/pkg/relayer/session/proof.go:70 +0x48
github.com/pokt-network/poktroll/pkg/observable/channel.goMapTransformNotification[...]({0x10370f970?, 0x140016311a0}, {0x1036eaa40, 0x140016c68a0?}, 0x14001529e30?, 0x14001529e78, 0x14000c1bab0)
        /Users/dk/pocket/poktroll-concurrent/pkg/observable/channel/map.go:125 +0x88
created by github.com/pokt-network/poktroll/pkg/observable/channel.Map[...] in goroutine 25
        /Users/dk/pocket/poktroll-concurrent/pkg/observable/channel/map.go:24 +0x170
FAIL    github.com/pokt-network/poktroll/pkg/relayer/session    1.117s
FAIL

Type of change

Select one or more from the following:

Sanity Checklist

  • I have updated the GitHub Issue assignees, reviewers, labels, project, iteration and milestone
  • For docs, I have run make docusaurus_start
  • For code, I have run make go_develop_and_test and make test_e2e
  • For code, I have added the devnet-test-e2e label to run E2E tests in CI
  • For configurations, I have update the documentation
  • I added TODOs where applicable

@okdas okdas added this to the Beta TestNet Iteration milestone Jan 31, 2025
@okdas okdas requested a review from red-0ne January 31, 2025 17:17
@okdas okdas self-assigned this Jan 31, 2025
@okdas okdas marked this pull request as ready for review January 31, 2025 17:18
@@ -73,9 +73,9 @@ func requireProofCountEqualsExpectedValueFromProofParams(t *testing.T, proofPara
}
supplierOperatorAddress := sample.AccAddress()
// Set the supplier operator balance to be able to submit the expected number of proofs.
feePerProof := prooftypes.DefaultParams().ProofSubmissionFee.Amount.Int64()
claimAndFeeGasCost := session.ClamAndProofGasCost.Amount.Int64()
Copy link
Member Author

Choose a reason for hiding this comment

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

Got a hint on this here

claimAndProofSubmissionCost := proofParams.GetProofSubmissionFee().Add(ClamAndProofGasCost)

@okdas
Copy link
Member Author

okdas commented Feb 1, 2025

@Olshansk @red-0ne @bryanchriswhite Merging to fix main branch tests. Lmk if you want any of this changed - I'll address asap.

@okdas okdas merged commit 7541afd into main Feb 1, 2025
10 checks passed
bryanchriswhite added a commit that referenced this pull request Feb 3, 2025
…034/feat/upload-state

* issues/1034/scaffold/morse_account_state:
  chore: review feedback improvements
  [Quick PE] Fix test after lowering MinProofSubmissionFee (#1051)
  chore: review feedback improvements
  fix: linter error
  chore: review feedback improvements
  [Tokenomics] Reduce MinProofSubmissionFee (#1042)
  [Proof] Implement scalable proof validation (#1031)
  refactor: morse types
  chore: review feedback improvements
  refactor: migration keeper in cosmos app
  chore: fix some function names in comment (#1019)

# Conflicts:
#	cmd/poktrolld/cmd/migrate/migrate_test.go
#	x/migration/keeper/msg_server_morse_account_state.go
#	x/migration/types/morse_account_state.go
bryanchriswhite added a commit that referenced this pull request Feb 4, 2025
…claim

* issues/1034/feat/upload-state:
  chore: review improvements
  chore: review improvements
  chore: review improvements
  chore: review improvements
  chore: review feedback improvements
  chore: improvements
  chore: review feedback improvements
  [Quick PE] Fix test after lowering MinProofSubmissionFee (#1051)
  chore: review feedback improvements
  fix: linter error
  chore: review feedback improvements
  [Tokenomics] Reduce MinProofSubmissionFee (#1042)
  [Proof] Implement scalable proof validation (#1031)
  refactor: morse types
  chore: review feedback improvements
  refactor: migration keeper in cosmos app
  chore: fix some function names in comment (#1019)

# Conflicts:
#	api/poktroll/migration/tx.pulsar.go
#	x/migration/types/tx.pb.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant