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

Danwt/keymap integration merge fbd6c40 #379

Closed
wants to merge 127 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
e51a7ba
Adds prototyping
Sep 9, 2022
d8b1db5
cp
Sep 9, 2022
05adc1f
cp
Sep 9, 2022
ec0b333
pt
Sep 9, 2022
46e54f9
Write more code for KeyDelegation
Sep 20, 2022
383bd04
cp
Sep 20, 2022
c27a62b
cp
Sep 20, 2022
07d8cdb
cp
Sep 20, 2022
72f48cc
replication
Sep 20, 2022
dc61748
typecheck
Sep 20, 2022
a732818
enable mappings
Sep 20, 2022
b4b3991
shuffle
Sep 20, 2022
c4ca116
mv, simplify model
Sep 20, 2022
8f29c60
cp test
Sep 20, 2022
4475b4d
prototype some test gen
Sep 21, 2022
ec54191
model update
Sep 21, 2022
95157a9
pre del comment
Sep 21, 2022
7a57f12
pre-tweak and del comment
Sep 21, 2022
e6bb623
CP test
Sep 21, 2022
ec727e7
CP keyguard test with fakeConsumer
Sep 21, 2022
0b048dc
Add property check, start testing
Sep 21, 2022
dceae78
pre rework valsets
Sep 21, 2022
d7e527a
Refactor test
Sep 21, 2022
7f3e812
cp
Sep 21, 2022
420cd07
rn
Sep 21, 2022
549d9af
CP
Sep 21, 2022
411928c
cp keyguard
Sep 21, 2022
67c136c
CP
Sep 21, 2022
cf31fbc
CP
Sep 21, 2022
68b439c
cp
Sep 21, 2022
17ee7f8
gi
Sep 21, 2022
82c127b
cp
Sep 21, 2022
6302dda
cp
Sep 21, 2022
252bbb4
Pass basic test
Sep 21, 2022
01c416c
checkpoint, passing a bunch
Sep 21, 2022
06d2f79
rename
Sep 21, 2022
8e5f250
Checkpoint
Sep 21, 2022
9cdd820
Work on gc
Sep 22, 2022
3c57520
cp
Sep 22, 2022
51e9e25
cp
Sep 22, 2022
54d7135
Pre-change way mapping is generated
Sep 22, 2022
8526678
cp
Sep 22, 2022
7f7bc65
pre rework map testing
Sep 22, 2022
2081454
cp
Sep 22, 2022
706dbc3
cp
Sep 22, 2022
dea61ec
cp
Sep 22, 2022
83ba7b2
cp
Sep 22, 2022
3f590b3
cp
Sep 22, 2022
636da59
impl garbage collection
Sep 22, 2022
3d26f3e
CP with better test
Sep 22, 2022
1c7f993
CP string
Oct 3, 2022
0d7ce22
typo
Oct 4, 2022
5327bb0
In test use list of foreignValSets for consistency
Oct 4, 2022
034ebc2
DEL TestActual
Oct 4, 2022
7556cd8
minor tidyups
Oct 4, 2022
438d509
Improve comment for queriesAndPruningProperty
Oct 4, 2022
be34202
RN garbage -> pruned
Oct 4, 2022
fd91d27
Improve test property descriptions
Oct 4, 2022
4dda68d
Work on slash query property
Oct 4, 2022
7cf7d1f
Clarify meaning of foregnValSets[i]
Oct 4, 2022
596b7f1
revert
Oct 4, 2022
b363366
Adds foreignValSetTimes to test
Oct 4, 2022
0f0c40d
field RN
Oct 4, 2022
9319d7a
cp
Oct 4, 2022
6b0c67a
checkpoint reasoning
Oct 4, 2022
ac842e2
CP
Oct 4, 2022
cb453d7
Partial improvement
Oct 4, 2022
d014bf4
CP
Oct 4, 2022
e2c9cc3
cp
Oct 4, 2022
706d634
Fix queryable
Oct 4, 2022
df2efa3
pre rework lastUpdate
Oct 4, 2022
84fdede
pre rework
Oct 4, 2022
a193a21
cp
Oct 4, 2022
6b7416c
Tests pass
Oct 4, 2022
6376ff4
CP
Oct 4, 2022
6631e84
Revert "CP"
Oct 4, 2022
4e624e8
minor
Oct 4, 2022
f83ae91
Simplify SetLocalToForeign
Oct 4, 2022
c96a8c3
Symbol renames
Oct 4, 2022
8a24382
Symbol rn
Oct 4, 2022
6ac40c6
Comments
Oct 4, 2022
3e4efda
(pass) rm docstrings
Oct 4, 2022
020e63c
Symbol rename
Oct 4, 2022
5b0870c
(pass) add intermediate
Oct 5, 2022
26811f3
Revert "(pass) add intermediate"
Oct 5, 2022
8751110
Add invariant
Oct 5, 2022
c0d6046
(pass) simplify
Oct 5, 2022
badd610
Simplify (field removal) (pass)
Oct 5, 2022
241e65a
(pass) simplify
Oct 5, 2022
0c980b7
(pass) symbol rename
Oct 5, 2022
1ebbcb9
(pass) add clarity panic
Oct 5, 2022
e293383
(pass) cleanup
Oct 5, 2022
9120e80
rename struct
Oct 5, 2022
4caa642
impl current mapping queries
Oct 5, 2022
a1165c3
rn
Oct 5, 2022
595aeab
merge main into
Oct 5, 2022
b047585
Change num traces
Oct 5, 2022
6d8bd93
Symbol rename
Oct 5, 2022
80763ae
Symbol renames
Oct 5, 2022
43d3f82
Better invariant comments
Oct 5, 2022
041d5d2
CP wording
Oct 5, 2022
7687cea
Better comments
Oct 5, 2022
dbc2517
CP docs progress
Oct 5, 2022
2d32f66
Major symbol renames
Oct 5, 2022
e7323c6
Docs
Oct 5, 2022
c860422
Start adding some basic unit tests
Oct 5, 2022
2a1c59c
DELETE unused TLA+ model
Oct 5, 2022
662e4f5
Symbol renames
Oct 5, 2022
12e1251
rn symbol keydel -> keymap
Oct 5, 2022
f849b02
CP branch
Oct 5, 2022
52acd19
get started
Oct 5, 2022
b1deb60
RN method TrySendValidatorUpdates
Oct 5, 2022
0a4d53f
Adds SetPendingVSCs method
Oct 5, 2022
054bba4
Refactors TrySendValidatorUpdates
Oct 5, 2022
15e4153
remove inUse var
Oct 5, 2022
e02d5e2
Adds temp changes to relay
Oct 5, 2022
04ffb23
Adds bytes.py
Oct 5, 2022
c4e0204
Adds store abstraction but does not use it
Oct 5, 2022
7ffba3b
Use store abstraction and pass tests
Oct 5, 2022
f27ab57
Move to keeper subdir
Oct 5, 2022
41d4802
Make keeper attempt
Oct 5, 2022
bf91d80
Integrate keymap into provider keeper dir
Oct 5, 2022
89ebcea
split keymap, keymap_core
Oct 5, 2022
4ba668a
rn _test -> core_test
Oct 5, 2022
8c380e9
bump
Oct 5, 2022
e2e3d88
Scratch up a basic doc
Oct 5, 2022
8f178d0
Manually revert relay.go
Oct 5, 2022
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
cp
  • Loading branch information
Daniel committed Sep 22, 2022
commit 706dbc36514a8dc37a2a3cee5af6240ce068e7a8
35 changes: 10 additions & 25 deletions x/ccv/provider/keydel/keydel_test.go
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@ const TRACE_LEN = 1000
const NUM_VALS = 3
const NUM_FKS = 9

type MapInstruction struct {
type mapInstruction struct {
lk LK
fk FK
}

type TraceState struct {
MapInstructions []MapInstruction
MapInstructions []mapInstruction
LocalUpdates []update
TP int
TC int
@@ -56,7 +56,7 @@ func (vs *ValSet) processUpdates(updates []update) {
}
}

func (d *Driver) applyMapInstruction(instructions []MapInstruction) {
func (d *Driver) applyMapInstruction(instructions []mapInstruction) {
for _, instruction := range instructions {
_ = d.e.SetLocalToForeign(instruction.lk, instruction.fk)
}
@@ -192,27 +192,12 @@ func (d *Driver) checkProperties() {

func getTrace(t *testing.T) []TraceState {

mappings := func() []MapInstruction {
// TODO: currently I don't generate partial mappings but I might want to
// Create a mapping of nums [0, NUM_VALS] mapped injectively to [0, NUM_FKS]
ret := map[LK]FK{}
good := func() bool {
if len(ret) != NUM_VALS {
return false
}
seen := map[FK]bool{}
for _, fk := range ret {
if _, ok := seen[fk]; ok {
return false
}
seen[fk] = true
}
return true
}
for !good() {
for lk := 0; lk < NUM_VALS; lk++ {
ret[lk] = rand.Intn(NUM_FKS)
}
mappings := func() []mapInstruction {
ret := []mapInstruction{}
// include 0 to all validators
include := rand.Intn(NUM_VALS + 1)
for _, lk := range rand.Perm(NUM_VALS)[0:include] {
ret = append(ret, mapInstruction{lk, rand.Intn(NUM_FKS)})
}
return ret
}
@@ -244,7 +229,7 @@ func getTrace(t *testing.T) []TraceState {
good := false
if choice == 0 {
ret = append(ret, TraceState{
MapInstructions: mapping(),
MapInstructions: mappings(),
LocalUpdates: localUpdates(),
TP: last.TP + 1,
TC: last.TC,