Skip to content

Commit 92c54ca

Browse files
clean up testing
1 parent a7675b0 commit 92c54ca

File tree

10 files changed

+1048
-1068
lines changed

10 files changed

+1048
-1068
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 10-attestations Light Client
2+
3+
An attestor-based IBC light client that verifies state using quorum-signed ECDSA attestations from a fixed set of trusted signers.
4+
5+
## Trust Model
6+
7+
- A fixed set of ECDSA attestors (EOA addresses) is configured at client creation
8+
- Updates require `minRequiredSigs` unique signatures from the attestor set
9+
10+
## State
11+
12+
**Client State**
13+
- `attestorAddresses` — trusted attestor set
14+
- `minRequiredSigs` — quorum threshold
15+
- `latestHeight` — highest trusted height
16+
- `isFrozen` — halts all operations when true
17+
18+
**Consensus State** (per height)
19+
- `timestamp` — trusted UNIX timestamp in nanoseconds
20+
21+
## Proofs
22+
23+
All proofs contain an `AttestationProof` with:
24+
- `attestationData` — the attested payload (encoded `StateAttestation` or `PacketAttestation`)
25+
- `signatures` — 65-byte ECDSA signatures over `sha256(attestationData)`
26+
27+
## Limitations
28+
29+
- No client recovery supported
30+
- No client upgrades supported
31+
- No attestor updates or rotation supported
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package attestations_test
2+
3+
import (
4+
attestations "github.com/cosmos/ibc-go/v10/modules/light-clients/10-attestations"
5+
)
6+
7+
func (s *AttestationsTestSuite) TestAttestationProofValidateBasic() {
8+
testCases := []struct {
9+
name string
10+
attestationProof attestations.AttestationProof
11+
expErr string
12+
}{
13+
{
14+
"valid proof",
15+
attestations.AttestationProof{
16+
AttestationData: []byte("valid data"),
17+
Signatures: [][]byte{make([]byte, 65)},
18+
},
19+
"",
20+
},
21+
{
22+
"empty attestation data",
23+
attestations.AttestationProof{
24+
AttestationData: []byte{},
25+
Signatures: [][]byte{make([]byte, 65)},
26+
},
27+
"attestation data cannot be empty",
28+
},
29+
{
30+
"empty signatures",
31+
attestations.AttestationProof{
32+
AttestationData: []byte("valid data"),
33+
Signatures: [][]byte{},
34+
},
35+
"signatures cannot be empty",
36+
},
37+
{
38+
"invalid signature length",
39+
attestations.AttestationProof{
40+
AttestationData: []byte("valid data"),
41+
Signatures: [][]byte{make([]byte, 64)},
42+
},
43+
"signature 0 has invalid length",
44+
},
45+
}
46+
47+
for _, tc := range testCases {
48+
s.Run(tc.name, func() {
49+
err := tc.attestationProof.ValidateBasic()
50+
if tc.expErr != "" {
51+
s.Require().Error(err)
52+
s.Require().ErrorContains(err, tc.expErr)
53+
} else {
54+
s.Require().NoError(err)
55+
}
56+
})
57+
}
58+
}

modules/light-clients/10-attestations/attestations.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)