Skip to content

Commit 43efaba

Browse files
committed
remove lastresulthash from state
1 parent e1fb239 commit 43efaba

File tree

12 files changed

+1
-46
lines changed

12 files changed

+1
-46
lines changed

block/internal/executing/executor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ func (e *Executor) Stop() error {
149149
func (e *Executor) GetLastState() types.State {
150150
state := e.getLastState()
151151
state.AppHash = bytes.Clone(state.AppHash)
152-
state.LastResultsHash = bytes.Clone(state.LastResultsHash)
153152

154153
return state
155154
}

block/internal/syncing/syncer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ func (s *Syncer) GetLastState() types.State {
158158

159159
stateCopy := *state
160160
stateCopy.AppHash = bytes.Clone(state.AppHash)
161-
stateCopy.LastResultsHash = bytes.Clone(state.LastResultsHash)
162161

163162
return stateCopy
164163
}

docs/adr/adr-004-core-types.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,9 @@ type Header struct {
5656
LastHeaderHash [32]byte
5757

5858
// hashes of block data
59-
LastCommitHash [32]byte // commit from aggregator(s) from the last block
6059
DataHash [32]byte // Block.Data root aka Transactions
61-
ConsensusHash [32]byte // consensus params for current block
6260
AppHash [32]byte // state after applying txs from the current block
6361

64-
// root hash of all results from the txs from the previous block
65-
// This is ABCI specific but smart-contract chains require some way of committing to transaction receipts/results.
66-
LastResultsHash [32]byte
67-
6862

6963
// Note that the address can be derived from the pubkey which can be derived
7064
// from the signature when using secp256k.

docs/adr/adr-015-rollkit-minimal-header.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,11 @@ This minimal Rollkit header can be transformed to be tailored to a specific exec
106106
This header can be transformed into an ABCI-specific header for IBC compatibility.
107107

108108
- `Version`: Required by IBC clients to correctly interpret the block's structure and contents.
109-
- `LastCommitHash`: The hash of the previous block's commit, used by IBC clients to verify the legitimacy of the block's state transitions.
110109
- `DataHash`: A hash of the block's transaction data, enabling IBC clients to verify that the data has not been tampered with. Can be constructed from unpacking the `DataCommitment` in Rollkit header.
111110
- `ValidatorHash`: Current validator set's hash, which IBC clients use to verify that the block was validated by the correct set of validators. This can be the IBC attester set of the chain for backward compatibility with the IBC Tendermint client, if needed.
112111
- `NextValidatorsHash`: The hash of the next validator set, allowing IBC clients to anticipate and verify upcoming validators.
113-
- `ConsensusHash`: Denotes the hash of the consensus parameters, ensuring that IBC clients are aligned with the consensus rules of the blockchain.
114112
- `AppHash`: Same as the `StateRoot` in the Rollkit Header.
115113
- `EvidenceHash`: A hash of evidence of any misbehavior by validators, which IBC clients use to assess the trustworthiness of the validator set.
116-
- `LastResultsHash`: Root hash of all results from the transactions from the previous block.
117114
- `ProposerAddress`: The address of the block proposer, allowing IBC clients to track and verify the entities proposing new blocks. Can be constructed from the `extraData` field in the Rollkit Header.
118115

119116
#### Transformation to ABCI Header
@@ -139,18 +136,12 @@ This header can be transformed into an ABCI-specific header for IBC compatibilit
139136
├─────────────────────┼───────────────────────┤
140137
│ Version │ Added for IBC │
141138
├─────────────────────┼───────────────────────┤
142-
│ LastCommitHash │ Added for IBC │
143-
├─────────────────────┼───────────────────────┤
144139
│ ValidatorHash │ Added for IBC │
145140
├─────────────────────┼───────────────────────┤
146141
│ NextValidatorsHash │ Added for IBC │
147142
├─────────────────────┼───────────────────────┤
148-
│ ConsensusHash │ Added for IBC │
149-
├─────────────────────┼───────────────────────┤
150143
│ EvidenceHash │ Added for IBC │
151144
├─────────────────────┼───────────────────────┤
152-
│ LastResultsHash │ Added for IBC │
153-
├─────────────────────┼───────────────────────┤
154145
│ ProposerAddress │ From ExtraData │
155146
└─────────────────────┴───────────────────────┘
156147
```

docs/learn/specs/block-validity.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ SignedHeader.Verify(untrustedHeader *SignedHeader)
7878
return error "headers are not adjacent"
7979
// Verify the link to previous header
8080
verify untrustedHeader.LastHeaderHash == h.Header.Hash()
81-
// Verify LastCommit hash matches previous signature
82-
verify untrustedHeader.LastCommitHash == sh.Signature.GetCommitHash(...)
8381
// Note: ValidatorHash field exists for compatibility but is not validated
8482
```
8583

@@ -112,11 +110,8 @@ SignedHeader.Verify(untrustedHeader *SignedHeader)
112110
| **Header** . | | |
113111
| Version | unused | |
114112
| LastHeaderHash | The hash of the previous accepted block | checked in the `Verify()`` step |
115-
| LastCommitHash | The hash of the previous accepted block's commit | checked in the `Verify()`` step |
116113
| DataHash | Correct hash of the block's Data field | checked in the `ValidateBasic()`` step |
117-
| ConsensusHash | unused | |
118114
| AppHash | The correct state root after executing the block's transactions against the accepted state | checked during block execution |
119-
| LastResultsHash | Correct results from executing transactions | checked during block execution |
120115
| ProposerAddress | Address of the expected proposer | Must match Signer.Address in SignedHeader |
121116
| ValidatorHash | Compatibility field for Tendermint light client | Not validated |
122117

docs/src/openapi-rpc.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -949,11 +949,6 @@
949949
"format": "int64",
950950
"description": "Data availability height"
951951
},
952-
"last_results_hash": {
953-
"type": "string",
954-
"format": "byte",
955-
"description": "Last results hash (base64-encoded)"
956-
},
957952
"app_hash": {
958953
"type": "string",
959954
"format": "byte",

pkg/rpc/server/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ func (s *StoreServer) GetState(
137137
LastBlockHeight: state.LastBlockHeight,
138138
LastBlockTime: timestamppb.New(state.LastBlockTime),
139139
DaHeight: state.DAHeight,
140-
LastResultsHash: state.LastResultsHash,
141140
ChainId: state.ChainID,
142141
Version: &pb.Version{
143142
Block: state.Version.Block,

tools/da-debug/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,7 @@ func displayHeader(header *types.SignedHeader) {
370370
fmt.Printf("Chain ID: %s\n", header.ChainID())
371371
fmt.Printf("Version: Block=%d, App=%d\n", header.Version.Block, header.Version.App)
372372
fmt.Printf("Last Header: %s\n", formatHashField(hex.EncodeToString(header.LastHeaderHash[:])))
373-
fmt.Printf("Last Commit: %s\n", formatHashField(hex.EncodeToString(header.LastCommitHash[:])))
374373
fmt.Printf("Data Hash: %s\n", formatHashField(hex.EncodeToString(header.DataHash[:])))
375-
fmt.Printf("Consensus: %s\n", formatHashField(hex.EncodeToString(header.ConsensusHash[:])))
376-
fmt.Printf("App Hash: %s\n", formatHashField(hex.EncodeToString(header.AppHash[:])))
377-
fmt.Printf("Last Results: %s\n", formatHashField(hex.EncodeToString(header.LastResultsHash[:])))
378374
fmt.Printf("Validator: %s\n", formatHashField(hex.EncodeToString(header.ValidatorHash[:])))
379375
fmt.Printf("Proposer: %s\n", formatHashField(hex.EncodeToString(header.ProposerAddress)))
380376
fmt.Printf("Signature: %s\n", formatHashField(hex.EncodeToString(header.Signature)))

types/serialization.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ func (s *State) ToProto() (*pb.State, error) {
271271
LastBlockHeight: s.LastBlockHeight,
272272
LastBlockTime: timestamppb.New(s.LastBlockTime),
273273
DaHeight: s.DAHeight,
274-
LastResultsHash: s.LastResultsHash[:],
275274
AppHash: s.AppHash[:],
276275
}, nil
277276
}
@@ -297,11 +296,6 @@ func (s *State) FromProto(other *pb.State) error {
297296
} else {
298297
s.LastBlockTime = time.Time{}
299298
}
300-
if other.LastResultsHash != nil {
301-
s.LastResultsHash = append([]byte(nil), other.LastResultsHash...)
302-
} else {
303-
s.LastResultsHash = nil
304-
}
305299
if other.AppHash != nil {
306300
s.AppHash = append([]byte(nil), other.AppHash...)
307301
} else {

types/serialization_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ func TestStateRoundTrip(t *testing.T) {
115115
LastBlockHeight: 987654321,
116116
LastBlockTime: time.Date(2022, 6, 6, 12, 12, 33, 44, time.UTC),
117117
DAHeight: 3344,
118-
LastResultsHash: Hash{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2},
119118
AppHash: Hash{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1},
120119
},
121120
},
@@ -388,7 +387,7 @@ func TestProtoConversionConsistency_AllTypes(t *testing.T) {
388387
assert.Equal(t, d, d2)
389388

390389
// State
391-
s := &State{Version: Version{Block: 1, App: 2}, ChainID: "cid", InitialHeight: 1, LastBlockHeight: 2, LastBlockTime: time.Now().UTC(), DAHeight: 3, LastResultsHash: []byte{1, 2}, AppHash: []byte{3, 4}}
390+
s := &State{Version: Version{Block: 1, App: 2}, ChainID: "cid", InitialHeight: 1, LastBlockHeight: 2, LastBlockTime: time.Now().UTC(), DAHeight: 3, AppHash: []byte{3, 4}}
392391
protoState, err := s.ToProto()
393392
assert.NoError(t, err)
394393
s2 := &State{}

0 commit comments

Comments
 (0)