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

abci: add preprocess block #110

Merged
merged 43 commits into from
Dec 15, 2020
Merged

abci: add preprocess block #110

merged 43 commits into from
Dec 15, 2020

Conversation

tac0turtle
Copy link
Collaborator

@tac0turtle tac0turtle commented Dec 11, 2020

Description

This pr adds preprocess block to abci

Closes: #XXX

ref: tendermint/spec#59

@liamsi
Copy link
Member

liamsi commented Dec 12, 2020

image

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Did a first pass. Awesome work!

I think we should populate the lazyledger specific fields directly instead of introducing a MetaData field in Block.Data.

abci/types/application.go Outdated Show resolved Hide resolved
proto/tendermint/types/types.proto Outdated Show resolved Hide resolved
types/block.go Outdated Show resolved Hide resolved
state/execution.go Outdated Show resolved Hide resolved

messages := types.MessagesFromProto(pbmessages)

return state.MakeBlock(height, processedTxs, evidence, nil, messages, commit, proposerAddr)
Copy link
Member

Choose a reason for hiding this comment

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

👍

abci/types/application.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Dec 14, 2020

Codecov Report

Merging #110 (dd9208a) into master (7ae7b13) will increase coverage by 1.70%.
The diff coverage is 4.00%.

@@            Coverage Diff             @@
##           master     tendermint/spec#110      +/-   ##
==========================================
+ Coverage   60.81%   62.51%   +1.70%     
==========================================
  Files         261      145     -116     
  Lines       24216    12092   -12124     
==========================================
- Hits        14726     7559    -7167     
+ Misses       7954     3718    -4236     
+ Partials     1536      815     -721     
Impacted Files Coverage Δ
state/execution.go 64.80% <0.00%> (-3.56%) ⬇️
state/state.go 83.89% <ø> (ø)
types/block.go 70.96% <0.00%> (-1.07%) ⬇️
types/test_util.go 55.35% <100.00%> (ø)
cmd/tendermint/commands/show_node_id.go
abci/types/pubkey.go
p2p/errors.go
p2p/trust/config.go
p2p/node_info.go
consensus/types/round_state.go
... and 101 more

@tac0turtle tac0turtle requested a review from liamsi December 15, 2020 12:10
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Great work @marbar3778! Thanks a lot.

LGTM

Comment on lines -33 to -35
- name: Set GOBIN
run: |
echo "::add-path::$(go env GOPATH)/bin"
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for taking care of this too! 🙏

DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing
EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set
Commit() ResponseCommit // Commit the state and return the application Merkle root hash
PreprocessTxs(RequestPreprocessTxs) ResponsePreprocessTxs // State machine preprocessing of txs
Copy link
Member

Choose a reason for hiding this comment

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

I'd move this in between InitChain and BeginBlock. But as this is only the interface it does not block merging this PR.

Comment on lines +269 to +272
message ResponsePreprocessTxs {
repeated bytes txs = 1;
tendermint.types.Messages messages = 2;
}
Copy link
Member

Choose a reason for hiding this comment

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

In a follow-ip issue, this will also return/include the intermediate state roots. Then, in another PR, this will enable immediate execution (ref #3 and https://github.com/tendermint/spec/issues/208#issuecomment-721158558)

Comment on lines +1247 to +1248
MessageEmpty = Message{}
MessagesEmpty = Messages{}
Copy link
Member

Choose a reason for hiding this comment

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

I think these vars won't be used outside of this package? If so, they should be unexported.

Comment on lines +292 to +293
block, _ := state.MakeBlock(height, makeTxs(height), nil,
nil, types.Messages{}, lastCommit, state.Validators.GetProposer().Address)
Copy link
Member

Choose a reason for hiding this comment

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

Optional nit: I think, here and in other places, where the line becomes too large, we should rather use one line per argument. I think that improves the readability compared to breaking the line somewhere in the middle.
Didn't this use to be convention in the tendermint code-base anyway?

@liamsi
Copy link
Member

liamsi commented Dec 15, 2020

The failing test, seems to be a non-deterministic flaky test unrelated to the changes here: tendermint/tendermint#1040

@liamsi liamsi merged commit fbf8ebb into celestiaorg:master Dec 15, 2020
evan-forbes pushed a commit that referenced this pull request Sep 21, 2021
* version docs

* stash commits

* fix url

* remove master from sidebar

* fix build errors

* move to consensus connection

* add process

* add proof to block

* add block metadata in beginBlcok

* fix testing

* regenerate mocks

* add in needed proto changes

* regenerate mocks

* fix makeblock calls

* Apply suggestions from code review

* fix rpc tests

* fix linting and ci errors

* fix consensus tests

* add preprocess to e2e

* add preprocess to counter app

* replace meta_data with messages

* fix linting

* Update state/execution.go

Co-authored-by: Ismail Khoffi <[email protected]>

* fix comment

* fix e2e tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Ismail Khoffi <[email protected]>
liamsi added a commit that referenced this pull request Sep 23, 2021
* version docs

* stash commits

* fix url

* remove master from sidebar

* fix build errors

* move to consensus connection

* add process

* add proof to block

* add block metadata in beginBlcok

* fix testing

* regenerate mocks

* add in needed proto changes

* regenerate mocks

* fix makeblock calls

* Apply suggestions from code review

* fix rpc tests

* fix linting and ci errors

* fix consensus tests

* add preprocess to e2e

* add preprocess to counter app

* replace meta_data with messages

* fix linting

* Update state/execution.go

Co-authored-by: Ismail Khoffi <[email protected]>

* fix comment

* fix e2e tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Ismail Khoffi <[email protected]>
evan-forbes pushed a commit that referenced this pull request Sep 23, 2021
* version docs

* stash commits

* fix url

* remove master from sidebar

* fix build errors

* move to consensus connection

* add process

* add proof to block

* add block metadata in beginBlcok

* fix testing

* regenerate mocks

* add in needed proto changes

* regenerate mocks

* fix makeblock calls

* Apply suggestions from code review

* fix rpc tests

* fix linting and ci errors

* fix consensus tests

* add preprocess to e2e

* add preprocess to counter app

* replace meta_data with messages

* fix linting

* Update state/execution.go

Co-authored-by: Ismail Khoffi <[email protected]>

* fix comment

* fix e2e tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Ismail Khoffi <[email protected]>

fix test so that it doesn't modify block data after generating the hash

fix missed make block api change

run make mockery

add some docs

fix hardcoded test

fix linter

fix hard coded test
evan-forbes pushed a commit that referenced this pull request Sep 24, 2021
* version docs

* stash commits

* fix url

* remove master from sidebar

* fix build errors

* move to consensus connection

* add process

* add proof to block

* add block metadata in beginBlcok

* fix testing

* regenerate mocks

* add in needed proto changes

* regenerate mocks

* fix makeblock calls

* Apply suggestions from code review

* fix rpc tests

* fix linting and ci errors

* fix consensus tests

* add preprocess to e2e

* add preprocess to counter app

* replace meta_data with messages

* fix linting

* Update state/execution.go

Co-authored-by: Ismail Khoffi <[email protected]>

* fix comment

* fix e2e tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Ismail Khoffi <[email protected]>

fix test so that it doesn't modify block data after generating the hash

fix missed make block api change

run make mockery

add some docs

fix hardcoded test

fix linter

fix hard coded test
cmwaters pushed a commit that referenced this pull request Mar 13, 2023
* [backport] Renaming in docker-related files (#123)

* [cherry-picked] Renaming in docker-related files (#110)

* Performed renaming in docker-related files

* Fix e2e launch

* Rename TENDERMINT_BUILD_OPTIONS to COMETBFT_BUILD_OPTIONS all over

* Revert `cometbft-proof` to `tendermint-proof`

* Replaced TENDERMINT_VERSION --> COMETBFT_VERSION all over the codebase

* [backport] Rename inside `test/e2e` (#139) (#144)

* Renamed all help text for cometbft CLI

* Update networks/local/localnode/Dockerfile

Co-authored-by: Thane Thomson <[email protected]>

Co-authored-by: Thane Thomson <[email protected]>
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.

3 participants