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

Add "query_global_state" query RPC to node #1645

Conversation

darthsiroftardis
Copy link
Contributor

@darthsiroftardis darthsiroftardis commented Jun 28, 2021

CHANGELOG:

  • Added a new "query_global_state" RPC endpoint that takes either a BlockHash or state_root_hash param to make query to GlobalState
  • Added a new GlobalStateIdentifier enum to the rpcs to support the query
  • Added a new query-global-state command the rust client that takes in a hash which is identified as either a block hash or state root hash along with a key and path arg (similar to the preexisting) query

PS: We could use a better distinction between the "state_get_item" query and the newly added with one this PR on the client side. I am open to suggestions for names that are more distinct

Closes: 1608

Copy link
Contributor

@nilz3ro nilz3ro left a comment

Choose a reason for hiding this comment

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

LGTM 🎊

@darthsiroftardis darthsiroftardis changed the title NDRS-1608: Add "query_global_state" query RPC to node Add "query_global_state" query RPC to node Jul 22, 2021
Copy link
Contributor

@nilz3ro nilz3ro left a comment

Choose a reason for hiding this comment

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

I found one small nitpick

client/src/global_state_query.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Fraser999 Fraser999 left a comment

Choose a reason for hiding this comment

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

There should be a casper_query_global_state() function added to the FFI, and casper_get_item should have the #[deprecated] attribute applied similar to the one suggested for get_item().

Also, there should be test cases for this new functionality added to integration_test.rs.

client/lib/lib.rs Outdated Show resolved Hide resolved
client/lib/lib.rs Outdated Show resolved Hide resolved
client/lib/lib.rs Outdated Show resolved Hide resolved
node/src/components/rpc_server/rpcs/state.rs Outdated Show resolved Hide resolved
client/src/main.rs Outdated Show resolved Hide resolved
client/src/common.rs Outdated Show resolved Hide resolved
client/lib/lib.rs Outdated Show resolved Hide resolved
client/lib/lib.rs Outdated Show resolved Hide resolved
client/src/common.rs Outdated Show resolved Hide resolved
client/lib/ffi.rs Outdated Show resolved Hide resolved
@darthsiroftardis
Copy link
Contributor Author

bors r+

@casperlabs-bors-ng
Copy link
Contributor

Build failed:

@darthsiroftardis
Copy link
Contributor Author

bors try

casperlabs-bors-ng bot added a commit that referenced this pull request Aug 13, 2021
@casperlabs-bors-ng
Copy link
Contributor

try

Build succeeded:

@darthsiroftardis
Copy link
Contributor Author

bors r+

@casperlabs-bors-ng
Copy link
Contributor

Build succeeded:

@casperlabs-bors-ng casperlabs-bors-ng bot merged commit f499ca4 into casper-network:dev Aug 13, 2021
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

3 participants