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
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ docs/tla/states/
*.out
vendor/
.vscode
x/ccv/provider/keyguard/__debug_bin
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/

COPY --from=is-builder /go/bin/interchain-security-pd /usr/local/bin/interchain-security-pd
COPY --from=is-builder /go/bin/interchain-security-cd /usr/local/bin/interchain-security-cd
COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain-security-cdd


# Copy in the shell scripts that run the testnet
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ install: go.sum
export CGO_LDFLAGS="-Wl,-z,relro,-z,now -fstack-protector"
go install $(BUILD_FLAGS) ./cmd/interchain-security-pd
go install $(BUILD_FLAGS) ./cmd/interchain-security-cd
go install $(BUILD_FLAGS) ./cmd/interchain-security-cdd

# run all tests: unit, e2e, diff, and integration
test:
Expand Down Expand Up @@ -41,8 +42,8 @@ $(BUILDDIR)/:
### Protobuf ###
###############################################################################

containerProtoVer=v0.7
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoVer=0.9.0
containerProtoImage=ghcr.io/cosmos/proto-builder:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)
containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer)
Expand Down
59 changes: 59 additions & 0 deletions app/consumer-democracy/ante_handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package app

import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
consumerante "github.com/cosmos/interchain-security/app/consumer/ante"
ibcconsumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *ibckeeper.Keeper
ConsumerKeeper ibcconsumerkeeper.Keeper
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

var sigGasConsumer = options.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(),
ante.NewRejectExtensionOptionsDecorator(),
consumerante.NewMsgFilterDecorator(options.ConsumerKeeper),
consumerante.NewDisabledModulesDecorator("/cosmos.evidence", "/cosmos.slashing"),
ante.NewMempoolFeeDecorator(),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
}
Loading