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

statecheck: Do not use indexer-internal APIs for node access #361

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

mitjat
Copy link
Contributor

@mitjat mitjat commented Mar 23, 2023

Before this PR, statecheck used indexer's internal libraries to access the node. This

  • Makes for less than ideal separation: Indexer proper now has methods that exist only for tests to run.
  • Makes it slightly harder/messier/more boilerplate-y to refactor those libraries for multiple-version support.

This PR makes the statecheck depend on the indexer less (actually not at all, except for DB utility wrappers). It does mean that we concede we won't run statecheck on anything but the version of oasis-core and oasis-sdk that it was compiled against. Not a loss IMO; we don't need huge generality there.

Testing: None 😬 because it's a bit of a pain to do, and the changes are such that the compiler should have caught any problems. Also, the statecheck is not hooked up to any alerts yet.

@mitjat mitjat force-pushed the mitjat/statecheck-no-internal-apis branch from 5022c00 to 4f51ad8 Compare March 23, 2023 04:19
Copy link
Collaborator

@Andrew7234 Andrew7234 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mitjat mitjat merged commit 060381d into main Mar 24, 2023
@mitjat mitjat deleted the mitjat/statecheck-no-internal-apis branch March 24, 2023 21:56
@pro-wh
Copy link
Collaborator

pro-wh commented Mar 27, 2023

o good, I can make the diff in #352 smaller

require.Nil(t, err)
oasisClient := conn.Consensus()
Copy link
Collaborator

Choose a reason for hiding this comment

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

ℹ️ the factory would do signature.SetChainContext, where the SDK connection doesn't. we have a few .Open(), but luckily they're on registry things that don't use the chain context

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for the tip; i was making the same mistake in the api-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants