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! : bump comet to v1 #19726

Merged
merged 56 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
107a940
start the chaos
tac0turtle Mar 12, 2024
cff8134
proto
tac0turtle Mar 12, 2024
55ac8e5
more changes
tac0turtle Mar 12, 2024
50d0784
something
tac0turtle Mar 12, 2024
f21cde6
attempt
tac0turtle Mar 12, 2024
6630131
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 9, 2024
9e09ec9
update
tac0turtle Apr 9, 2024
1bee088
more changes
tac0turtle Apr 9, 2024
5df1afa
push
tac0turtle Apr 9, 2024
74c7696
fix proto
tac0turtle Apr 9, 2024
7d60e29
push changes
tac0turtle Apr 9, 2024
e58094a
fixes
tac0turtle Apr 9, 2024
2a0a638
fixes
tac0turtle Apr 9, 2024
7b7a72a
more changes
tac0turtle Apr 10, 2024
5426341
more changes
tac0turtle Apr 11, 2024
5d8d8ec
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 17, 2024
a61a494
more changes
tac0turtle Apr 17, 2024
3590ae4
further changes
tac0turtle Apr 17, 2024
ae3a98c
bump
tac0turtle Apr 18, 2024
aef320b
building
tac0turtle Apr 18, 2024
1c11514
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 18, 2024
b54af91
fix some tests and runners
tac0turtle Apr 18, 2024
1f73fd5
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 23, 2024
4de8bf3
fix apis
tac0turtle Apr 23, 2024
1c99034
fix mocks
tac0turtle Apr 23, 2024
3891f14
revert 1.21.0
tac0turtle Apr 23, 2024
b0cef04
generate proto changes
tac0turtle Apr 23, 2024
d977c25
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 29, 2024
65f8249
generate mocks
tac0turtle Apr 29, 2024
c17da7f
fix some tests
tac0turtle Apr 29, 2024
c894b1f
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 29, 2024
908d707
return non epmty string
tac0turtle Apr 29, 2024
15aa804
update to later comet
tac0turtle Apr 29, 2024
773216a
linting
tac0turtle Apr 30, 2024
55711d6
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 30, 2024
e56fa5c
linting
tac0turtle Apr 30, 2024
da3344e
Merge branch 'main' into marko/comet/v1
tac0turtle Apr 30, 2024
452572f
remove helper
tac0turtle Apr 30, 2024
ae20616
Merge branch 'main' into marko/comet/v1
tac0turtle May 2, 2024
9b8bcbc
Merge branch 'main' into marko/comet/v1
tac0turtle May 3, 2024
70b9fb1
go mod changes
tac0turtle May 3, 2024
9151648
fix import
tac0turtle May 3, 2024
e316656
generate types
tac0turtle May 3, 2024
1d93815
go 1.22
tac0turtle May 3, 2024
a427150
break it
tac0turtle May 3, 2024
399cf8b
Merge branch 'main' into marko/comet/v1
tac0turtle May 3, 2024
5ba7815
nix update
tac0turtle May 3, 2024
2a5e51c
testing
tac0turtle May 3, 2024
9aa6152
fix gomod2nix
yihuang May 4, 2024
1f781ab
Merge branch 'main' into marko/comet/v1
tac0turtle May 6, 2024
4e16311
generate mocks
tac0turtle May 6, 2024
7066e02
changelog
tac0turtle May 6, 2024
23e543a
linting
tac0turtle May 6, 2024
aefdebd
fixes
tac0turtle May 6, 2024
06bf802
Merge branch 'main' into marko/comet/v1
tac0turtle May 6, 2024
17861be
Merge branch 'main' into marko/comet/v1
tac0turtle May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more changes
  • Loading branch information
tac0turtle committed Apr 10, 2024
commit 7b7a72a161cc47ac3fed4d221385f8884c8d2493
114 changes: 57 additions & 57 deletions baseapp/abci.go

Large diffs are not rendered by default.

380 changes: 190 additions & 190 deletions baseapp/abci_test.go

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions baseapp/abci_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (h *DefaultProposalHandler) SetTxSelector(ts TxSelector) {
// requested from CometBFT will simply be returned, which, by default, are in
// FIFO order.
func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler {
return func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
return func(ctx sdk.Context, req *abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error) {
var maxBlockGas uint64
if b := ctx.ConsensusParams().Block; b != nil {
maxBlockGas = uint64(b.MaxGas)
Expand All @@ -273,7 +273,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan
}
}

return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs(ctx)}, nil
return &abci.PrepareProposalResponse{Txs: h.txSelector.SelectedTxs(ctx)}, nil
}

iterator := h.mempool.Select(ctx, req.Txs)
Expand Down Expand Up @@ -348,7 +348,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan
iterator = iterator.Next()
}

return &abci.ResponsePrepareProposal{Txs: h.txSelector.SelectedTxs(ctx)}, nil
return &abci.PrepareProposalResponse{Txs: h.txSelector.SelectedTxs(ctx)}, nil
}
}

Expand All @@ -371,7 +371,7 @@ func (h *DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHan
return NoOpProcessProposal()
}

return func(ctx sdk.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
return func(ctx sdk.Context, req *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error) {
var totalTxGas uint64

var maxBlockGas int64
Expand All @@ -382,7 +382,7 @@ func (h *DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHan
for _, txBytes := range req.Txs {
tx, err := h.txVerifier.ProcessProposalVerifyTx(txBytes)
if err != nil {
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil
return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil
}

if maxBlockGas > 0 {
Expand All @@ -392,44 +392,44 @@ func (h *DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHan
}

if totalTxGas > uint64(maxBlockGas) {
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil
return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_REJECT}, nil
}
}
}

return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil
return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil
}
}

// NoOpPrepareProposal defines a no-op PrepareProposal handler. It will always
// return the transactions sent by the client's request.
func NoOpPrepareProposal() sdk.PrepareProposalHandler {
return func(_ sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil
return func(_ sdk.Context, req *abci.PrepareProposalRequest) (*abci.PrepareProposalResponse, error) {
return &abci.PrepareProposalResponse{Txs: req.Txs}, nil
}
}

// NoOpProcessProposal defines a no-op ProcessProposal Handler. It will always
// return ACCEPT.
func NoOpProcessProposal() sdk.ProcessProposalHandler {
return func(_ sdk.Context, _ *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error) {
return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT}, nil
return func(_ sdk.Context, _ *abci.ProcessProposalRequest) (*abci.ProcessProposalResponse, error) {
return &abci.ProcessProposalResponse{Status: abci.PROCESS_PROPOSAL_STATUS_ACCEPT}, nil
}
}

// NoOpExtendVote defines a no-op ExtendVote handler. It will always return an
// empty byte slice as the vote extension.
func NoOpExtendVote() sdk.ExtendVoteHandler {
return func(_ sdk.Context, _ *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) {
return &abci.ResponseExtendVote{VoteExtension: []byte{}}, nil
return func(_ sdk.Context, _ *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error) {
return &abci.ExtendVoteResponse{VoteExtension: []byte{}}, nil
}
}

// NoOpVerifyVoteExtensionHandler defines a no-op VerifyVoteExtension handler. It
// will always return an ACCEPT status with no error.
func NoOpVerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler {
return func(_ sdk.Context, _ *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) {
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil
return func(_ sdk.Context, _ *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error) {
return &abci.VerifyVoteExtensionResponse{Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT}, nil
}
}

Expand Down
22 changes: 11 additions & 11 deletions baseapp/abci_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,12 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_NoOpMempoolTxSelection()

testCases := map[string]struct {
ctx sdk.Context
req *abci.RequestPrepareProposal
req *abci.PrepareProposalRequest
expectedTxs int
}{
"small max tx bytes": {
ctx: s.ctx,
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
Txs: [][]byte{txBz, txBz, txBz, txBz, txBz},
MaxTxBytes: 10,
},
Expand All @@ -516,23 +516,23 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_NoOpMempoolTxSelection()
MaxGas: 10,
},
}),
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
Txs: [][]byte{txBz, txBz, txBz, txBz, txBz},
MaxTxBytes: 465,
},
expectedTxs: 0,
},
"large max tx bytes": {
ctx: s.ctx,
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
Txs: [][]byte{txBz, txBz, txBz, txBz, txBz},
MaxTxBytes: 465,
},
expectedTxs: 3,
},
"large max tx bytes len calculation": {
ctx: s.ctx,
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
Txs: [][]byte{txBz, txBz, txBz, txBz, txBz},
MaxTxBytes: 456,
},
Expand All @@ -544,7 +544,7 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_NoOpMempoolTxSelection()
MaxGas: 200,
},
}),
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
Txs: [][]byte{txBz, txBz, txBz, txBz, txBz},
MaxTxBytes: 465,
},
Expand Down Expand Up @@ -628,22 +628,22 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSe
testCases := map[string]struct {
ctx sdk.Context
txInputs []testTx
req *abci.RequestPrepareProposal
req *abci.PrepareProposalRequest
handler sdk.PrepareProposalHandler
expectedTxs []int
}{
"skip same-sender non-sequential sequence and then add others txs": {
ctx: s.ctx,
txInputs: []testTx{testTxs[0], testTxs[1], testTxs[2], testTxs[3]},
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
MaxTxBytes: 180 + 181,
},
expectedTxs: []int{0, 3},
},
"skip multi-signers msg non-sequential sequence": {
ctx: s.ctx,
txInputs: []testTx{testTxs[4], testTxs[5], testTxs[6], testTxs[7], testTxs[8]},
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
MaxTxBytes: 263 + 264,
},
expectedTxs: []int{4, 8},
Expand All @@ -652,7 +652,7 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSe
// Because tx 10 is valid, tx 11 can't be valid as they have higher sequence numbers.
ctx: s.ctx,
txInputs: []testTx{testTxs[9], testTxs[10], testTxs[11]},
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
MaxTxBytes: 263 + 264,
},
expectedTxs: []int{9},
Expand All @@ -662,7 +662,7 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSe
// the rest of the txs fail because they have a seq of 4.
ctx: s.ctx,
txInputs: []testTx{testTxs[12], testTxs[13], testTxs[14]},
req: &abci.RequestPrepareProposal{
req: &abci.PrepareProposalRequest{
MaxTxBytes: 112,
},
expectedTxs: []int{},
Expand Down
Loading
Loading