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

[Testing, Tooling] chore: in-memory network interface & config types #289

Merged
merged 60 commits into from
Jan 10, 2024

Conversation

bryanchriswhite
Copy link
Contributor

@bryanchriswhite bryanchriswhite commented Dec 21, 2023

Summary

Human Summary

  • Regenerates pre-generated accounts with proper bech32 prefix.
  • Adds InMemoryCosmosNetwork interface type.
  • Adds InMemoryNetworkConfig concrete type.

Issue

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Testing

  • Run all unit tests: make go_develop_and_test
  • Run E2E tests locally: make test_e2e
  • Run E2E tests on DevNet: Add the devnet-test-e2e label to the PR. This is VERY expensive, only do it after all the reviews are complete.

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have performed a self-review of my own code
  • I have commented my code, updated documentation and left TODOs throughout the codebase

@bryanchriswhite bryanchriswhite added testing Test (or test utils) additions, fixes, improvements or other tooling Tooling - CLI, scripts, helpers, off-chain, etc... labels Dec 21, 2023
@bryanchriswhite bryanchriswhite added this to the Shannon TestNet milestone Dec 21, 2023
@bryanchriswhite bryanchriswhite self-assigned this Dec 21, 2023
@bryanchriswhite bryanchriswhite changed the title [Testing, Tooling] feat: add in memory network interface & config types [Testing, Tooling] chore: in-memory network interface & config types Dec 21, 2023
@bryanchriswhite bryanchriswhite force-pushed the issues/141/prep/in-memory-network branch 2 times, most recently from 5414460 to e3c3f8c Compare December 21, 2023 20:10
bryanchriswhite and others added 12 commits December 22, 2023 14:36
Co-authored-by: harry <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: harry <[email protected]>
…im-proof

* pokt/main:
  Fix bug introduced by #252 where genesis file was no longer being copied to the right location
  [Docs] Introduce Docusaurus documentation (#252)
  [Cleanup] Centralzie websocket url -> endpoint changes (#272)
  refactor: `NewMinedRelay` to shared testutil (#262)
  fix: PR template typo 2 (#269)
  [Testing] Unit tests, E2E tests, logging and other Fixes / "Touchups" (#253)
  [SDK] feat: Have distinct JSON-RPC and gRPC urls (#261)
…or/supplier-keys

* issues/141/refactor/claim-proof:
  chore: review feedback improvements
  chore: review feedback improvements
  Fix bug introduced by #252 where genesis file was no longer being copied to the right location
  [Docs] Introduce Docusaurus documentation (#252)
  [Cleanup] Centralzie websocket url -> endpoint changes (#272)
  refactor: `NewMinedRelay` to shared testutil (#262)
  fix: PR template typo 2 (#269)
  [Testing] Unit tests, E2E tests, logging and other Fixes / "Touchups" (#253)
  [SDK] feat: Have distinct JSON-RPC and gRPC urls (#261)
…ctor/supplier-errors

* issues/141/refactor/supplier-keys:
  chore: review feedback improvements
  chore: review feedback improvements
  Fix bug introduced by #252 where genesis file was no longer being copied to the right location
  [Docs] Introduce Docusaurus documentation (#252)
  [Cleanup] Centralzie websocket url -> endpoint changes (#272)
  refactor: `NewMinedRelay` to shared testutil (#262)
  fix: PR template typo 2 (#269)
  [Testing] Unit tests, E2E tests, logging and other Fixes / "Touchups" (#253)
  [SDK] feat: Have distinct JSON-RPC and gRPC urls (#261)
testutil/network/config.go Outdated Show resolved Hide resolved
sh.session.SessionNumber = int64(sh.blockHeight / NumBlocksPerSession)
sh.session.SessionNumber = sh.blockHeight / NumBlocksPerSession

// TODO_BLOCKER: SessionStartBlockHeight should be aligned to NumBlocksPerSession.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice TODO

encoding = app.MakeEncodingConfig()
chainID = "chain-" + rand.NewRand().Str(6)
)
return network.Config{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the answer to #303 is in this struct somewhere.

@h5law
Copy link
Contributor

h5law commented Jan 9, 2024

@bryanchriswhite forgot to leave a a comment pre-emptive approving while u fix them as they are minor

testutil/network/interface.go Outdated Show resolved Hide resolved
func (cfg *InMemoryNetworkConfig) GetNumKeyringAccounts(t *testing.T) int {
t.Helper()

return cfg.NumGateways + cfg.NumSuppliers + cfg.GetNumApplications(t)
Copy link
Member

Choose a reason for hiding this comment

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

  1. Re assumption w.r.t #GetNumKeyringAccounts. 👍 and doesn't even need a comment
  2. Regarding #GetNumApplications(), I think we should add a comment above the return w/ something like "NumApplications is intentionally a computed field" and potentially link to this comment.

Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

Left one outstanding comment but otherwise lgtm!

bryanchriswhite and others added 20 commits January 10, 2024 10:16
Co-authored-by: h5law <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
…im-proof

* pokt/main:
  [Supplier] refactor: claim & proof protobufs + (#263)
…plier-keys

* pokt/main:
  [Supplier] refactor: supplier module keys (#264)
…ctor/supplier-errors

* issues/141/refactor/supplier-keys:
  [Supplier] refactor: supplier module keys (#264)
  [Supplier] refactor: claim & proof protobufs + (#263)
…plier-errors

* pokt/main:
  [Supplier] refactor: supplier module errors (#265)
…ep/in-memory-network

* issues/141/refactor/supplier-errors:
  [Supplier] refactor: supplier module errors (#265)
  [Supplier] refactor: supplier module keys (#264)
  [Supplier] refactor: claim & proof protobufs + (#263)
@bryanchriswhite bryanchriswhite changed the base branch from issues/141/refactor/supplier-errors to main January 10, 2024 13:06
@bryanchriswhite bryanchriswhite merged commit db80345 into main Jan 10, 2024
10 checks passed
bryanchriswhite added a commit that referenced this pull request Jan 10, 2024
…ry-network

* pokt/main:
  [Testing, Tooling] chore: in-memory network interface & config types (#289)
bryanchriswhite added a commit that referenced this pull request Jan 10, 2024
…/in-memory-network

* issues/141/prep/in-memory-network:
  [Testing, Tooling] chore: in-memory network interface & config types (#289)
  trigger CI
  [Supplier] refactor: supplier module errors (#265)
  [Supplier] refactor: supplier module keys (#264)
  [Supplier] refactor: claim & proof protobufs + (#263)
  chore: review feedback improvements
  [Configs] feat: Add staking config parser of gateway staking (#302)
  chore: review feedback improvements
  fix: usage raw string literal
  chore: review feedback improvements
  [RingCache] Invalidate Cache On Redelegation Events (#239)
bryanchriswhite added a commit that referenced this pull request Jan 12, 2024
…ctor/in-memory-network

* issues/141/feat/in-memory-network:
  chore: review feedback improvements
  feat: update SMT to v0.9.2 (#311)
  fix: linter errors
  fixup! chore: review feedback improvements
  chore: review feedback improvements
  chore: review feedback improvements
  [Testing, Tooling] chore: in-memory network interface & config types (#289)
  trigger CI
  [Supplier] refactor: supplier module errors (#265)
  [Supplier] refactor: supplier module keys (#264)
  [Supplier] refactor: claim & proof protobufs + (#263)
  chore: review feedback improvements
  [Configs] feat: Add staking config parser of gateway staking (#302)
  chore: review feedback improvements
  fix: usage raw string literal
  chore: review feedback improvements
  [RingCache] Invalidate Cache On Redelegation Events (#239)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Test (or test utils) additions, fixes, improvements or other tooling Tooling - CLI, scripts, helpers, off-chain, etc...
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants