Skip to content

Commit

Permalink
fix!(rollapp): remove rollapp deprecated fields (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
omritoptix authored Apr 11, 2024
1 parent 6afec61 commit 23e429d
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 538 deletions.
5 changes: 2 additions & 3 deletions ibctesting/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ func (suite *IBCTestUtilSuite) UpdateRollappState(endHeight uint64) {
blockDescriptors := &rollapptypes.BlockDescriptors{BD: make([]rollapptypes.BlockDescriptor, numBlocks)}
for i := 0; i < int(numBlocks); i++ {
blockDescriptors.BD[i] = rollapptypes.BlockDescriptor{
Height: startHeight + uint64(i),
StateRoot: bytes.Repeat([]byte{byte(startHeight) + byte(i)}, 32),
IntermediateStatesRoot: bytes.Repeat([]byte{byte(startHeight) + byte(i)}, 32),
Height: startHeight + uint64(i),
StateRoot: bytes.Repeat([]byte{byte(startHeight) + byte(i)}, 32),
}
}
// Update the state
Expand Down
3 changes: 0 additions & 3 deletions proto/dymension/rollapp/block_descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ message BlockDescriptor {
uint64 height = 1;
// stateRoot is a 32 byte array of the hash of the block (state root of the block)
bytes stateRoot = 2;
// intermediateStatesRoot is a 32 byte array representing
// the root of a Merkle tree built from the ISRs of the block (Intermediate State Roots)
bytes intermediateStatesRoot = 3;
}

// BlockDescriptors defines list of BlockDescriptor.
Expand Down
19 changes: 6 additions & 13 deletions proto/dymension/rollapp/rollapp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,19 @@ message Rollapp {
// version is the software and configuration version.
// starts from 1 and increases by one on every MsgUpdateState
uint64 version = 3;
// codeStamp is a generated hash for unique identification of the rollapp code.
string codeStamp = 4 [deprecated=true];
// genesisPath is the description of the genesis file location on the DA.
string genesisPath = 5 [deprecated=true];
// maxWithholdingBlocks is the maximum number of blocks for
// an active sequencer to send a state update (MsgUpdateState).
uint64 maxWithholdingBlocks = 6 [deprecated=true];
// maxSequencers is the maximum number of sequencers.
uint64 maxSequencers = 7;
uint64 maxSequencers = 4;
// permissionedAddresses is a bech32-encoded address list of the sequencers that are allowed to serve this rollappId.
// In the case of an empty list, the rollapp is considered permissionless.
repeated string permissionedAddresses = 8;
repeated string permissionedAddresses = 5;
// tokenMetadata is a list of TokenMetadata that are registered on this rollapp
repeated TokenMetadata tokenMetadata = 9;
repeated TokenMetadata tokenMetadata = 6;
// genesis_state is a partial repr of the state the hub can expect the rollapp to be in upon genesis
RollappGenesisState genesis_state = 10 [(gogoproto.nullable) = false];
RollappGenesisState genesis_state = 7 [(gogoproto.nullable) = false];
// channel_id will be set to the canonical IBC channel of the rollapp.
string channel_id = 11;
string channel_id = 8;
// frozen is a boolean that indicates if the rollapp is frozen.
bool frozen = 12;
bool frozen = 9;
}

// Rollapp summary is a compact representation of Rollapp
Expand Down
7 changes: 0 additions & 7 deletions proto/dymension/rollapp/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ message MsgCreateRollapp {
// rollappId is the unique identifier of the rollapp chain.
// The rollappId follows the same standard as cosmos chain_id
string rollappId = 2;// [(gogoproto.customname) = "ChainID"];
// codeStamp is the description of the genesis file location on the DA
string codeStamp = 3 [deprecated=true];
// genesisPath is the description of the genesis file location on the DA
string genesisPath = 4 [deprecated=true];
// maxWithholdingBlocks is the maximum number of blocks for
// an active sequencer to send a state update (MsgUpdateState)
uint64 maxWithholdingBlocks = 5 [deprecated=true];
// maxSequencers is the maximum number of sequencers
uint64 maxSequencers = 6;
// permissionedAddresses is a bech32-encoded address list of the
Expand Down
5 changes: 2 additions & 3 deletions x/rollapp/simulation/update_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ func SimulateMsgUpdateState(
bds := types.BlockDescriptors{}
for i := uint64(0); i < numBlocks; i++ {
bds.BD = append(bds.BD, types.BlockDescriptor{
Height: startHeight + i,
StateRoot: make([]byte, 32),
IntermediateStatesRoot: make([]byte, 32),
Height: startHeight + i,
StateRoot: make([]byte, 32),
})
}

Expand Down
76 changes: 10 additions & 66 deletions x/rollapp/types/block_descriptor.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion x/rollapp/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var (
ErrWrongBlockHeight = errorsmod.Register(ModuleName, 1009, "start-height does not match rollapps state")
ErrMultiUpdateStateInBlock = errorsmod.Register(ModuleName, 1010, "only one state update can take place per block")
ErrInvalidStateRoot = errorsmod.Register(ModuleName, 1011, "invalid blocks state root")
ErrInvalidIntermediateStatesRoot = errorsmod.Register(ModuleName, 1012, "invalid blocks intermediate states root")
ErrUnauthorizedRollappCreator = errorsmod.Register(ModuleName, 1013, "rollapp creator not registered in the whitelist")
ErrInvalidClientType = errorsmod.Register(ModuleName, 1014, "client type of the rollapp isn't dymint")
ErrHeightStateNotFinalized = errorsmod.Register(ModuleName, 1015, "rollapp block on this height was not finalized yet")
Expand Down
5 changes: 0 additions & 5 deletions x/rollapp/types/message_update_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ func (msg *MsgUpdateState) ValidateBasic() error {
return sdkerrors.Wrapf(ErrInvalidStateRoot, "StateRoot of block high (%d) must be 32 byte array. But received (%d) bytes",
msg.BDs.BD[bdIndex].Height, len(msg.BDs.BD[bdIndex].StateRoot))
}
// check to see IntermediateStatesRoot is a 32 byte array
if len(msg.BDs.BD[bdIndex].IntermediateStatesRoot) != 32 {
return sdkerrors.Wrapf(ErrInvalidIntermediateStatesRoot, "IntermediateStatesRoot of block high (%d) must be 32 byte array. But received (%d) bytes",
msg.BDs.BD[bdIndex].Height, len(msg.BDs.BD[bdIndex].IntermediateStatesRoot))
}
}

return nil
Expand Down
Loading

0 comments on commit 23e429d

Please sign in to comment.