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(manager): rename rollappConsensusParams to rollappParams #1065

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion block/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestApplyBlock(t *testing.T) {
app.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{})
app.On("DeliverTx", mock.Anything).Return(abci.ResponseDeliverTx{})
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "celestia",
Version: "abcde",
},
Expand Down
12 changes: 6 additions & 6 deletions block/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestProduceOnlyAfterSynced(t *testing.T) {
// Init app
app := testutil.GetAppMock(testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -212,7 +212,7 @@ func TestProduceNewBlock(t *testing.T) {
commitHash := [32]byte{1}
app.On("Commit", mock.Anything).Return(abci.ResponseCommit{Data: commitHash[:]})
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -245,7 +245,7 @@ func TestProducePendingBlock(t *testing.T) {
commitHash := [32]byte{1}
app.On("Commit", mock.Anything).Return(abci.ResponseCommit{Data: commitHash[:]})
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -359,7 +359,7 @@ func TestProduceBlockFailAfterCommit(t *testing.T) {
LastBlockAppHash: tc.LastAppCommitHash[:],
})
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -391,7 +391,7 @@ func TestCreateNextDABatchWithBytesLimit(t *testing.T) {
require := require.New(t)
app := testutil.GetAppMock(testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -473,7 +473,7 @@ func TestDAFetch(t *testing.T) {
// Setup app
app := testutil.GetAppMock(testutil.Info, testutil.Commit, testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down
4 changes: 2 additions & 2 deletions block/production_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestCreateEmptyBlocksEnableDisable(t *testing.T) {
require := require.New(t)
app := testutil.GetAppMock(testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestStopBlockProduction(t *testing.T) {

app := testutil.GetAppMock(testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down
21 changes: 18 additions & 3 deletions block/pruning_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
package block_test

/*func TestPruningRetainHeight(t *testing.T) {
import (
"context"
"testing"

"github.com/dymensionxyz/dymint/da"
"github.com/dymensionxyz/dymint/testutil"
"github.com/dymensionxyz/dymint/version"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/proxy"
)

func TestPruningRetainHeight(t *testing.T) {
require := require.New(t)
app := testutil.GetAppMock()
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -58,4 +73,4 @@ package block_test

err = manager.PruneBlocks(validRetainHeight)
require.NoError(err)
}*/
}
6 changes: 3 additions & 3 deletions block/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ func (e *Executor) UpdateStateAfterCommit(s *types.State, resp *tmstate.ABCIResp
s.ConsensusParams.Block.MaxGas = resp.EndBlock.ConsensusParamUpdates.Block.MaxGas
s.ConsensusParams.Block.MaxBytes = resp.EndBlock.ConsensusParamUpdates.Block.MaxBytes
}
if resp.EndBlock.RollappConsensusParamUpdates != nil {
s.RollappParams.Da = resp.EndBlock.RollappConsensusParamUpdates.Da
s.RollappParams.Version = resp.EndBlock.RollappConsensusParamUpdates.Version
if resp.EndBlock.RollappParamUpdates != nil {
s.RollappParams.Da = resp.EndBlock.RollappParamUpdates.Da
s.RollappParams.Version = resp.EndBlock.RollappParamUpdates.Version
}
}

Expand Down
8 changes: 4 additions & 4 deletions block/submit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestBatchSubmissionHappyFlow(t *testing.T) {
err := proxyApp.Start()
require.NoError(err)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestBatchSubmissionFailedSubmission(t *testing.T) {
app := testutil.GetAppMock(testutil.EndBlock)
ctx := context.Background()
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -221,7 +221,7 @@ func TestSubmissionByTime(t *testing.T) {
require := require.New(t)
app := testutil.GetAppMock(testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down Expand Up @@ -304,7 +304,7 @@ func TestSubmissionByBatchSize(t *testing.T) {
for _, c := range cases {
app := testutil.GetAppMock(testutil.EndBlock)
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ replace (
github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.3
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4
github.com/gorilla/rpc => github.com/dymensionxyz/rpc v1.3.1
github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20240906093934-57cd50faef13
github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e
)

replace github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM=
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/dymensionxyz/cometbft v0.34.29-0.20240906093934-57cd50faef13 h1:Bz7HmEY2v76i+9ODm5yDArQk5pZw3ND0ecKVbD7Gt4I=
github.com/dymensionxyz/cometbft v0.34.29-0.20240906093934-57cd50faef13/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw=
github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e h1:A5FIvuFPvdxShuf9mSHfDUEL7I/oKVcSr1AtSlmgskA=
github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw=
github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg=
github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s=
github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240411195658-f7cd96f53b56 h1:cmpJYdRviuUfmlJdHrcAND8Jd6JIY4rp63bWAQzPr54=
Expand Down
5 changes: 2 additions & 3 deletions proto/types/dymint/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ message State {
uint64 base_height = 17;

SequencerSet sequencerSet = 18 [(gogoproto.nullable) = false];
RollappConsensusParams rollapp_params = 19 [(gogoproto.nullable) = false];
RollappParams rollapp_params = 19 [(gogoproto.nullable) = false];

}

//rollapp params defined in genesis and updated via gov proposal
message RollappConsensusParams {

message RollappParams {
//data availability type (e.g. celestia) used in the rollapp
string da = 1 ;
//commit used for the rollapp executable
Expand Down
2 changes: 1 addition & 1 deletion rpc/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func TestTx(t *testing.T) {
require.NotNil(rpc)
mockApp.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{})
mockApp.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down
2 changes: 1 addition & 1 deletion rpc/json/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func getRPC(t *testing.T) (*tmmocks.MockApplication, *client.Client) {
app.On("InitChain", mock.Anything).Return(abci.ResponseInitChain{})
app.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{})
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "mock",
Version: version.Commit,
},
Expand Down
2 changes: 1 addition & 1 deletion testutil/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func CreateNode(isSequencer bool, blockManagerConfig *config.BlockManagerConfig,
return nil, err
}
app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{
RollappConsensusParamUpdates: &abci.RollappConsensusParams{
RollappParamUpdates: &abci.RollappParams{
Da: "celestia",
Version: "abcde",
},
Expand Down
2 changes: 1 addition & 1 deletion testutil/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func GenerateStateWithSequencer(initialHeight int64, lastBlockHeight int64, pubk
App: AppVersion,
},
},
RollappParams: dymint.RollappConsensusParams{
RollappParams: dymint.RollappParams{
Da: "mock",
Version: dymintversion.Commit,
},
Expand Down
Loading
Loading