-
Notifications
You must be signed in to change notification settings - Fork 11
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
Binary port balance query #274
Merged
jacek-casper
merged 10 commits into
casper-network:feat-2.0
from
jacek-casper:binary-port-balance-query
Apr 11, 2024
Merged
Binary port balance query #274
jacek-casper
merged 10 commits into
casper-network:feat-2.0
from
jacek-casper:binary-port-balance-query
Apr 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
casperlabs-bors-ng bot
added a commit
to casper-network/casper-node
that referenced
this pull request
Apr 9, 2024
4645: Binary port balance query r=jacek-casper a=jacek-casper This PR adds a new request to the binary port that allows querying for balance directly. - I've added some additional types to `binary_port`, they're very similar to the existing `storage` types, with some slight adjustments to adapt them to the binary port: - added `BalanceResponse` for the new response payload type - added `PurseIdentifier` for specifying what balance to query, it's basically `BalanceIdentifier`, but without PenalizedAccount and Internal variants (these two look like they're for internal use only) - added `GlobalStateRequest::BalanceByStateRoot`, which has a state identifier, a purse identifier and a timestamp for holds lookup, it uses a `Timestamp` unlike the `storage` types which use `HoldsEpoch`, because `HoldsEpoch` requires a chainspec value to construct (balance hold interval) - added `GlobalStateRequest::BalanceByBlock`, which has a block identifier and a purse identifier, the holds timestamp is derived from the block Also: - boxed the `GetRequest::State` variant because it started triggering a lint - added some missing handling for `WasmV1Result` Related sidecar changes: casper-network/casper-sidecar#274 4650: Fix a bug in the BlockValidator r=fizyk20 a=fizyk20 Closes #4619 This is a simple, slightly hacky approach to solving the issue - but a less hacky one involving adding more variants to `BlockValidationState` and storing the state immediately after receiving a request turned out to become quite complex, which is why I chose this way eventually. 4653: Use custom Serialize/Deserialize for EntityAddr r=jacek-casper a=jacek-casper The existing Serialize/Deserialize impls encode the address as a JSON array of bytes instead of the formatted string format. This PR fixes that. There was also an issue with the schema, which I addressed here as well. Co-authored-by: Jacek Malec <[email protected]> Co-authored-by: Bartłomiej Kamiński <[email protected]>
casperlabs-bors-ng bot
added a commit
to casper-network/casper-node
that referenced
this pull request
Apr 9, 2024
4645: Binary port balance query r=jacek-casper a=jacek-casper This PR adds a new request to the binary port that allows querying for balance directly. - I've added some additional types to `binary_port`, they're very similar to the existing `storage` types, with some slight adjustments to adapt them to the binary port: - added `BalanceResponse` for the new response payload type - added `PurseIdentifier` for specifying what balance to query, it's basically `BalanceIdentifier`, but without PenalizedAccount and Internal variants (these two look like they're for internal use only) - added `GlobalStateRequest::BalanceByStateRoot`, which has a state identifier, a purse identifier and a timestamp for holds lookup, it uses a `Timestamp` unlike the `storage` types which use `HoldsEpoch`, because `HoldsEpoch` requires a chainspec value to construct (balance hold interval) - added `GlobalStateRequest::BalanceByBlock`, which has a block identifier and a purse identifier, the holds timestamp is derived from the block Also: - boxed the `GetRequest::State` variant because it started triggering a lint - added some missing handling for `WasmV1Result` Related sidecar changes: casper-network/casper-sidecar#274 4650: Fix a bug in the BlockValidator r=fizyk20 a=fizyk20 Closes #4619 This is a simple, slightly hacky approach to solving the issue - but a less hacky one involving adding more variants to `BlockValidationState` and storing the state immediately after receiving a request turned out to become quite complex, which is why I chose this way eventually. Co-authored-by: Jacek Malec <[email protected]> Co-authored-by: Bartłomiej Kamiński <[email protected]>
casperlabs-bors-ng bot
added a commit
to casper-network/casper-node
that referenced
this pull request
Apr 9, 2024
4645: Binary port balance query r=jacek-casper a=jacek-casper This PR adds a new request to the binary port that allows querying for balance directly. - I've added some additional types to `binary_port`, they're very similar to the existing `storage` types, with some slight adjustments to adapt them to the binary port: - added `BalanceResponse` for the new response payload type - added `PurseIdentifier` for specifying what balance to query, it's basically `BalanceIdentifier`, but without PenalizedAccount and Internal variants (these two look like they're for internal use only) - added `GlobalStateRequest::BalanceByStateRoot`, which has a state identifier, a purse identifier and a timestamp for holds lookup, it uses a `Timestamp` unlike the `storage` types which use `HoldsEpoch`, because `HoldsEpoch` requires a chainspec value to construct (balance hold interval) - added `GlobalStateRequest::BalanceByBlock`, which has a block identifier and a purse identifier, the holds timestamp is derived from the block Also: - boxed the `GetRequest::State` variant because it started triggering a lint - added some missing handling for `WasmV1Result` Related sidecar changes: casper-network/casper-sidecar#274 Co-authored-by: Jacek Malec <[email protected]>
casperlabs-bors-ng bot
added a commit
to casper-network/casper-node
that referenced
this pull request
Apr 10, 2024
4645: Binary port balance query r=jacek-casper a=jacek-casper This PR adds a new request to the binary port that allows querying for balance directly. - I've added some additional types to `binary_port`, they're very similar to the existing `storage` types, with some slight adjustments to adapt them to the binary port: - added `BalanceResponse` for the new response payload type - added `PurseIdentifier` for specifying what balance to query, it's basically `BalanceIdentifier`, but without PenalizedAccount and Internal variants (these two look like they're for internal use only) - added `GlobalStateRequest::BalanceByStateRoot`, which has a state identifier, a purse identifier and a timestamp for holds lookup, it uses a `Timestamp` unlike the `storage` types which use `HoldsEpoch`, because `HoldsEpoch` requires a chainspec value to construct (balance hold interval) - added `GlobalStateRequest::BalanceByBlock`, which has a block identifier and a purse identifier, the holds timestamp is derived from the block Also: - boxed the `GetRequest::State` variant because it started triggering a lint - added some missing handling for `WasmV1Result` Related sidecar changes: casper-network/casper-sidecar#274 4653: Use custom Serialize/Deserialize for EntityAddr r=jacek-casper a=jacek-casper The existing Serialize/Deserialize impls encode the address as a JSON array of bytes instead of the formatted string format. This PR fixes that. There was also an issue with the schema, which I addressed here as well. Co-authored-by: Jacek Malec <[email protected]>
casperlabs-bors-ng bot
added a commit
to casper-network/casper-node
that referenced
this pull request
Apr 10, 2024
4645: Binary port balance query r=jacek-casper a=jacek-casper This PR adds a new request to the binary port that allows querying for balance directly. - I've added some additional types to `binary_port`, they're very similar to the existing `storage` types, with some slight adjustments to adapt them to the binary port: - added `BalanceResponse` for the new response payload type - added `PurseIdentifier` for specifying what balance to query, it's basically `BalanceIdentifier`, but without PenalizedAccount and Internal variants (these two look like they're for internal use only) - added `GlobalStateRequest::BalanceByStateRoot`, which has a state identifier, a purse identifier and a timestamp for holds lookup, it uses a `Timestamp` unlike the `storage` types which use `HoldsEpoch`, because `HoldsEpoch` requires a chainspec value to construct (balance hold interval) - added `GlobalStateRequest::BalanceByBlock`, which has a block identifier and a purse identifier, the holds timestamp is derived from the block Also: - boxed the `GetRequest::State` variant because it started triggering a lint - added some missing handling for `WasmV1Result` Related sidecar changes: casper-network/casper-sidecar#274 4653: Use custom Serialize/Deserialize for EntityAddr r=jacek-casper a=jacek-casper The existing Serialize/Deserialize impls encode the address as a JSON array of bytes instead of the formatted string format. This PR fixes that. There was also an issue with the schema, which I addressed here as well. Co-authored-by: Jacek Malec <[email protected]>
rafal-ch
approved these changes
Apr 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modifies existing GetBalance and QueryBalance and adds QueryBalanceDetails.
Depends on: casper-network/casper-node#4645