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

Merge abci-rs in tendermint-rs repository #489

Closed
wants to merge 1 commit into from
Closed

Merge abci-rs in tendermint-rs repository #489

wants to merge 1 commit into from

Conversation

devashishdxt
Copy link

Merging abci-rs crate in tendermint-rs repository as suggested by @tomtau here. Also, continuing discussion on #29.

async-std = { version = "1.6", optional = true }
async-trait = "0.1"
bytes = "0.5"
integer-encoding = { version = "1.1", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a small bug in the released integer-encoding: dermesser/integer-encoding-rs#10
not sure of the impact. but it's a fairly small crate / code needed here, so could be possibly copied / vendored in here directly?

Copy link
Member

Choose a reason for hiding this comment

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

From tendermint/rust-abci#134 it seems we're not reading the first byte? Was it just being ignored or? Trying to understand the state of things and how this bug was surfaced in the first place

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems it's being read (https://github.com/tendermint/rust-abci/blob/develop/src/codec.rs#L26 -- or @yihuang why it's not?) and under normal circumstances, TM would be writing terminated varints as lengths ?

Copy link
Member

Choose a reason for hiding this comment

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

what does terminated mean here? do we mean like a terminal byte in the varint encoding, ie. where the MSB is not set? I think that first "length of length" is always just one byte here so should always be terminal, and should probably also always be small (like 1-3, maybe max 10, since theres a limit on how big a msg tendermint would send).

Copy link
Contributor

Choose a reason for hiding this comment

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

terminated varint -- the last byte has MSB set.
the code in rust-abci seems to match what's in Golang:
https://github.com/tendermint/tendermint/blob/master/abci/types/messages.go#L54

Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

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

That's great. Quick early feedback, as we this becomes part of the tendermint workspace we can safely drop the -rs suffix in the crate name.

@devashishdxt
Copy link
Author

That's great. Quick early feedback, as we this becomes part of the tendermint workspace we can safely drop the -rs suffix in the crate name.

Done.

@tomtau
Copy link
Contributor

tomtau commented Aug 5, 2020

@xla it'll also be needed that @zramsay transfers https://crates.io/crates/abci ownership

@xla
Copy link
Contributor

xla commented Aug 5, 2020

@xla it'll also be needed that @zramsay transfers https://crates.io/crates/abci ownership

Good point, maybe @ebuchman can follow up on this.

@tac0turtle
Copy link
Contributor

This PR may need some reworking around the generated proto files after: #508 lands.

@tomtau
Copy link
Contributor

tomtau commented Aug 11, 2020

#510

@tomtau
Copy link
Contributor

tomtau commented Aug 11, 2020

#508 is merged -- @marbar3778 I guess the natural thing here will be to remove abci-rs's types + build.rs and just use the "tendermint-proto" crate?

@devashishdxt
Copy link
Author

#508 is merged -- @marbar3778 I guess the natural thing here will be to remove abci-rs's types + build.rs and just use the "tendermint-proto" crate?

tendermint-proto is not yet released on crates.io

@tomtau
Copy link
Contributor

tomtau commented Aug 11, 2020

#508 is merged -- @marbar3778 I guess the natural thing here will be to remove abci-rs's types + build.rs and just use the "tendermint-proto" crate?

tendermint-proto is not yet released on crates.io

since this will be in the same repo, the dependency can be specified with path = "....."?

@tomtau tomtau mentioned this pull request Aug 12, 2020
@zramsay
Copy link

zramsay commented Aug 12, 2020

@xla it'll also be needed that @zramsay transfers https://crates.io/crates/abci ownership

Good point, maybe @ebuchman can follow up on this.

invites sent to @xla and @liamsi

@devashishdxt
Copy link
Author

#508 is merged -- @marbar3778 I guess the natural thing here will be to remove abci-rs's types + build.rs and just use the "tendermint-proto" crate?

Pushed the changes. Also included changes for tendermint StateSync.

Comment on lines +148 to +158
while let Ok(request) = decode(&mut stream).await {
match request {
Some(request) => {
let response = inner.process(request).await;

if let Err(err) = encode(response, &mut stream).await {
error!(message = "Error while writing to stream", %err, ?peer_addr);
}
}
None => debug!(message = "Received empty request", ?peer_addr),
}
Copy link
Contributor

@tomtau tomtau Aug 13, 2020

Choose a reason for hiding this comment

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

awaiting may need some re-work to follow the async CheckTx/DeliverTx semantics when it could potentially be processing another request while response to the previous one is being written out (in order): #29 (comment)

Copy link
Author

Choose a reason for hiding this comment

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

@devashishdxt devashishdxt mentioned this pull request Dec 22, 2020
11 tasks
@thanethomson
Copy link
Contributor

@devashishdxt, after much discussion the team decided to go with #794. We still, however, think that abci-rs is a great alternative option to that in #794, and look forward to seeing people use whichever framework they feel is better suited to their particular use case (we think it's a great thing for people to have multiple options).

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.

7 participants