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

refactor: change tmblock to sdkblock #11390

Merged
merged 21 commits into from
Jul 13, 2022
Merged

refactor: change tmblock to sdkblock #11390

merged 21 commits into from
Jul 13, 2022

Conversation

atheeshp
Copy link
Contributor

Description

Closes: #3544


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added the C:CLI label Mar 16, 2022
@atheeshp atheeshp marked this pull request as ready for review March 16, 2022 11:35
@@ -85,7 +85,7 @@ message GetBlockByHeightRequest {
// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method.
message GetBlockByHeightResponse {
.tendermint.types.BlockID block_id = 1;
.tendermint.types.Block block = 2;
Block block = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

We unfortunately can't do that without bumping to v1beta2.

Can we instead add a new field in the Response message?

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

blocking for now because it is proto breaking

client/grpc/tmservice/util.go Outdated Show resolved Hide resolved
client/grpc/tmservice/util.go Outdated Show resolved Hide resolved
@amaury1093
Copy link
Contributor

@atheeshp Do we also have an endpoint for SDK blocks? maybe we can just put the bech32 addresses in that block.

@tac0turtle
Copy link
Member

@@ -94,7 +94,7 @@ message GetLatestBlockRequest {}
// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method.
message GetLatestBlockResponse {
.tendermint.types.BlockID block_id = 1;
.tendermint.types.Block block = 2;
Block block = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

So we can't change this, neither here nor on the TxService as marko suggested here #11390 (comment), because both would be proto-breaking.

What we can do is simply add a new proposer string field to either or both of these 2 response types.

The alternative is to add a new field sdk_block on either or both of these 2 response types, which has the new Block type.

@amaury1093 amaury1093 marked this pull request as draft March 30, 2022 14:38
@amaury1093
Copy link
Contributor

Punting this to later, when 0.46 QA is done.

@tac0turtle tac0turtle added the S:blocked Status: Blocked label May 9, 2022
@tac0turtle
Copy link
Member

@atheeshp should we assign this to someone else or are you fine to finish it

@atheeshp
Copy link
Contributor Author

atheeshp commented Jun 14, 2022

@atheeshp should we assign this to someone else or are you fine to finish it

I can continue this, this is halted due to 0.46.

@tac0turtle tac0turtle removed the S:blocked Status: Blocked label Jun 14, 2022
@atheeshp atheeshp requested a review from amaury1093 July 7, 2022 06:37
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Overall lgtm, let's also add a changelog. I propose to deprecate the usage of the TM block type, and just use ours.

@@ -100,6 +101,7 @@ message GetBlockByHeightRequest {
message GetBlockByHeightResponse {
.tendermint.types.BlockID block_id = 1;
.tendermint.types.Block block = 2;
Block sdk_block = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a comment "Since", and also what's the difference between this and block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a field proposer_address with type bytes in tm block, and in sdk block it is changed to string

proto/cosmos/base/tendermint/v1beta1/query.proto Outdated Show resolved Hide resolved
@atheeshp atheeshp marked this pull request as ready for review July 12, 2022 07:08
@atheeshp atheeshp requested a review from a team as a code owner July 12, 2022 07:08
@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #11390 (51663c9) into main (203d563) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11390      +/-   ##
==========================================
- Coverage   65.32%   65.27%   -0.05%     
==========================================
  Files         693      694       +1     
  Lines       71823    71851      +28     
==========================================
- Hits        46916    46899      -17     
- Misses      22268    22314      +46     
+ Partials     2639     2638       -1     
Impacted Files Coverage Δ
client/grpc/tmservice/service.go 0.00% <0.00%> (ø)
client/grpc/tmservice/util.go 0.00% <0.00%> (ø)
x/distribution/simulation/operations.go 80.85% <0.00%> (-9.58%) ⬇️
crypto/keys/internal/ecdsa/privkey.go 83.01% <0.00%> (+1.88%) ⬆️

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

LGTM, should we backport this?

Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

LGTM, I added some suggestions for comments to make it clear what we're doing here.

proto/cosmos/base/tendermint/v1beta1/query.proto Outdated Show resolved Hide resolved
proto/cosmos/base/tendermint/v1beta1/query.proto Outdated Show resolved Hide resolved
proto/cosmos/base/tendermint/v1beta1/query.proto Outdated Show resolved Hide resolved
proto/cosmos/base/tendermint/v1beta1/query.proto Outdated Show resolved Hide resolved
proto/cosmos/base/tendermint/v1beta1/types.proto Outdated Show resolved Hide resolved
proto/cosmos/base/tendermint/v1beta1/types.proto Outdated Show resolved Hide resolved
.tendermint.types.Block block = 2 [deprecated = true];

// since: v0.47
Block sdk_block = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about the sdk_block name. Any other ideas, maybe @alexanderbez ?

Copy link
Member

Choose a reason for hiding this comment

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

I guess the main issue with naming here is no matter what in the future we will rename it to block instead of whatever its called. It might be fine for now then

@amaury1093 amaury1093 added the backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release label Jul 13, 2022
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

thanks @atheeshp

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Jul 13, 2022
@mergify mergify bot merged commit e89db04 into main Jul 13, 2022
@mergify mergify bot deleted the ap/byte-to-string branch July 13, 2022 09:47
mergify bot pushed a commit that referenced this pull request Jul 13, 2022
## Description

Closes: #3544

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

(cherry picked from commit e89db04)

# Conflicts:
#	api/cosmos/base/tendermint/v1beta1/query.pulsar.go
#	client/grpc/tmservice/query.pb.go
tac0turtle pushed a commit that referenced this pull request Jul 13, 2022
* refactor: change tmblock to sdkblock (#11390)

## Description

Closes: #3544

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

(cherry picked from commit e89db04)

# Conflicts:
#	api/cosmos/base/tendermint/v1beta1/query.pulsar.go
#	client/grpc/tmservice/query.pb.go

* resolve conflicts

* remove api/

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
JeancarloBarrios pushed a commit to agoric-labs/cosmos-sdk that referenced this pull request Sep 28, 2024
…12549)

* refactor: change tmblock to sdkblock (cosmos#11390)

## Description

Closes: cosmos#3544

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

(cherry picked from commit e89db04)

# Conflicts:
#	api/cosmos/base/tendermint/v1beta1/query.pulsar.go
#	client/grpc/tmservice/query.pb.go

* resolve conflicts

* remove api/

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release C:CLI
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Convert Tendermint Block Response
5 participants