-
Notifications
You must be signed in to change notification settings - Fork 610
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
IBC-rate-limiting: modify the contract interface to handle the packet #3234
Merged
Merged
Changes from all commits
Commits
Show all changes
294 commits
Select commit
Hold shift + click to select a range
fb072ed
added multiple quotas
nicolaslara 010628c
small fixes
nicolaslara c604c0d
reordered imports
nicolaslara b9ffbab
added management messages
nicolaslara 1ec6b8e
reorganized management messages and experimenting with e2e testing
nicolaslara 73607f7
commenting out test configuration test for now
nicolaslara 241aa9e
added query
nicolaslara 66a55b0
added flow unit test
nicolaslara 73535d4
cleanup
nicolaslara 8f8b7d2
added AddChannel tests
nicolaslara e007ca6
format
nicolaslara b16fa70
test values are properly stored
nicolaslara c171bb8
testing remove channel
nicolaslara 8ca29e7
some more rate limiting tests
nicolaslara 66c3346
moved tests about test setup to the right place
nicolaslara 3a37701
fixed params
nicolaslara 8c97907
Merge branch 'main' into ibc-rate-limit
nicolaslara 6a331dd
merged main
nicolaslara 5ef145e
running gofumpt
nicolaslara 0a2656c
added ibc-rate-limiting contract
nicolaslara 2fd6e04
added ibc-rate-limit middleware
nicolaslara 49ad2cd
Merge branch 'nicolas/ibc-rate-limit-middlware' into nicolas/ibc-rate…
nicolaslara 7105550
added chain integration and tests
nicolaslara 17c05af
reverted change to match merged branch in main (#2341 instead of #2274)
nicolaslara a6cf294
added cosmwasm workflow
nicolaslara 4855c0f
Merge branch 'nicolas/ibc-rate-limit-contract' into nicolas/ibc-rate-…
nicolaslara 3d8aa96
added a migrate message
nicolaslara 318cf57
added some doc comments to the state
nicolaslara 15cbcec
added doc comments
nicolaslara 3357e94
fixed dependency after merging https://github.com/osmosis-labs/cosmos…
nicolaslara 9f605fc
added migration msg
nicolaslara 70a11b4
added workflow
nicolaslara 2daf2ba
experimenting with better workflow
nicolaslara be0fa76
added missing $
nicolaslara 04a2a7a
using env
nicolaslara 26fc15b
Update x/ibc-rate-limit/contracts/rate-limiter/src/msg.rs
nicolaslara 2723f07
using stable for clippy
nicolaslara a9dd5bf
removed gitkeep
nicolaslara 94f079b
Merge branch 'nicolas/ibc-rate-limit-contract' into ibc-rate-limit
nicolaslara a7e7d75
using the minimal profile for clippy
nicolaslara 8917e77
experimenting with cache
nicolaslara 61bc4fe
removed target from lints
nicolaslara 67b1477
cleaner matrix?
nicolaslara 11c5765
COmments & questions
ValarDragon 1f237e8
Merge branch 'nicolas/ibc-rate-limit-contract' of github.com:osmosis-…
ValarDragon d9dd5b3
debugging
nicolaslara bf41b6f
more debugging
nicolaslara 8b6390b
debug faster
nicolaslara 1faa8c5
quick cache debug
nicolaslara a8a9b88
typo
nicolaslara 12accb3
quick workflow check
nicolaslara aee867f
working tests with optimization
nicolaslara 2758919
testing artifacts
nicolaslara f726d2c
split the wasm target into its own step
nicolaslara 506453a
artifacts without slash
nicolaslara 2fa15b8
full working tests
nicolaslara 4b66483
clippy fixes
nicolaslara 8128b0c
Merge branch 'nicolas/ibc-rate-limit-contract' into ibc-rate-limit
nicolaslara 73acb2f
workflow without test data checks and clippy fixes
nicolaslara 5b66bdc
renamed CHANNEL_FLOWS
nicolaslara 2e4a6ab
renaming and code clenaup
nicolaslara 4af7fe9
more renames
nicolaslara 48b19cb
renames and code fixes
nicolaslara 0dd7fc9
Merge branch 'nicolas/ibc-rate-limit-contract' into ibc-rate-limit
nicolaslara 6180eb8
reordered imports
nicolaslara 82c83b1
cargo fmt
nicolaslara 92b4bb3
Merge branch 'nicolas/ibc-rate-limit-contract' into ibc-rate-limit
nicolaslara d4ace7b
added danom tracking
nicolaslara 746daa9
cleanup
nicolaslara fe97ee8
refactoring
nicolaslara c6758f1
changes to the expiration logic so that balances are calculated based…
nicolaslara e1d52f4
slightly slower but considerably cleanner
nicolaslara 7434a44
cleanup attributes and removed redundancy when not testing
nicolaslara 727fef2
update to edition 2021
nicolaslara 7859a55
added comments explaining the tests
nicolaslara 628db47
removed .beaker
nicolaslara 9facb27
unified gitignore
nicolaslara 042f3f4
removed second gitignore
nicolaslara c37a968
better doc comments
nicolaslara e5d72d6
spelling
nicolaslara d658fdd
spelling
nicolaslara c2a72ad
added channel value cache
nicolaslara 0b738c9
Merge branch 'nicolas/ibc-rate-limit-contract' into ibc-rate-limit
nicolaslara 71d8aca
updated the middlware to use the new contract interface
nicolaslara 8135a90
update middleware to match new contract interface
nicolaslara 2151825
added missing updates
nicolaslara a800e9b
updated dependencies
nicolaslara ae15972
added missing helpers
nicolaslara f8b972a
go.mod changes shouldn't be in this branch
nicolaslara e15c77c
Revert "go.mod changes shouldn't be in this branch"
nicolaslara 63b23f0
moved send and receive to sudo
nicolaslara 7aa90e3
reorganizing
nicolaslara fcec5b9
calling the contract via sudo
nicolaslara 7acacb3
lint
nicolaslara 4268c79
removed gitkeep
nicolaslara 80617e8
using sudo instead of execute
nicolaslara 0529667
cleaned up and updated contract and integration
nicolaslara 294e19a
updated x86 test wasm file
nicolaslara 6c49460
fixed bad print
nicolaslara 3028b38
storing and instantiating the contract
nicolaslara f332e23
setting up E2E tests for ibc rate limits
nicolaslara 5bdccfc
fixed proposal. Now just have to get the math right and cleanup
nicolaslara b9408e6
Using the supply for the channel value
nicolaslara 6916ffa
experimenting with e2e tests
nicolaslara 216bcee
passing the contract keeper instead of instantiating it each time
nicolaslara f1cdb16
changes from code review
nicolaslara 314455e
added contract from main and changes to the middleware from code review
nicolaslara 0aed029
using the correct bank supply method
nicolaslara 54056fa
debugging issues with e2e tests. Everything works after one interacti…
nicolaslara cd74eaa
Merge branch 'main' into nicolas/merged-supply-offset-dependency
nicolaslara a69b58f
updated dependency to match latest sdk form (now that the changes to …
nicolaslara e8e9012
working E2E test for rate limiting
nicolaslara 381e5e2
added e2e tests and changes from code review
nicolaslara fa8cafe
removed debug logs
nicolaslara cc91a76
remove debug logs
nicolaslara bbcc8af
Merge branch 'main' into nicolas/ibc-rate-limit-middlware
nicolaslara d4e10bd
Merge branch 'ibc-rate-limit' into nicolas/ibc-rate-limit-integration…
nicolaslara 45ca648
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
nicolaslara c425518
Merge branch 'nicolas/merged-supply-offset-dependency' into nicolas/i…
nicolaslara fde1440
Merge branch 'nicolas/merged-supply-offset-dependency' into nicolas/i…
nicolaslara 79843a1
Merge branch 'nicolas/merged-supply-offset-dependency' into ibc-rate-…
nicolaslara fd54ed3
updated test to also use GetSupplyWithOffset
nicolaslara 298636d
using correct GetSupplyWithOffset method
nicolaslara 5561530
using correct GetSupplyWithOffset method
nicolaslara 6e47abc
lint
nicolaslara deaacfd
Merge branch 'ibc-rate-limit' into nicolas/ibc-rate-limit-integration…
nicolaslara c676404
removed e2e from this branch as it's not doing anything without the i…
nicolaslara 7544235
lint
nicolaslara 98b720d
Merge branch 'ibc-rate-limit' into nicolas/ibc-rate-limit-integration…
nicolaslara a7f5bc4
tests fail on CI because of "inactive" proposal. Is the deposit the i…
nicolaslara 89cf19f
remove rate limiting after the test so it doesn't interfeer with the …
nicolaslara 10424b4
using standard proposals instead of expedited
nicolaslara 4b23e98
Merge branch 'ibc-rate-limit' into nicolas/ibc-rate-limit-integration…
nicolaslara 443fff3
added packet reverts on unsuccessful acks and timeouts
nicolaslara 76c9cc9
lint
nicolaslara d46b51c
ran gofumpt
nicolaslara af4d9a7
lint
nicolaslara 2751bee
added undo to the contract
nicolaslara b682542
integrating undo
nicolaslara fa12ff0
updated contract with x86 wasm file
nicolaslara 25a7767
added undo for sent packages when they are rejected bia timeout or a …
nicolaslara 219118c
added a readme
nicolaslara 803d26e
markdown lint
nicolaslara f474ee4
added readme
nicolaslara a3f82e9
abstracted params
nicolaslara ddfcac0
better params and param tests
nicolaslara 3018357
using a helper function instead of returning from the test
nicolaslara 42b354d
updated contract to allow for undo
nicolaslara 3350c57
added undo, readme, and cleanup based on reviews
nicolaslara a183a0e
Merge branch 'main' into ibc-rate-limit
nicolaslara 2825e21
updated wasm file with x86 version
nicolaslara ca5fecf
using string params in e2e tests
nicolaslara 20b40de
Merge branch 'main' into nicolas/ibc-rate-limit-middlware
nicolaslara 3f98ebe
Merge branch 'main' into ibc-rate-limit
nicolaslara 463f1cc
updated to v12
nicolaslara eb6471b
removed unnecessary keeper
nicolaslara f2ba12f
only exposing what's needed
nicolaslara 4b68e46
refactoring
nicolaslara 1506c3f
updated types
nicolaslara 33ad060
added shell history to gitignore
nicolaslara 30fb80b
adding only one wasm file to the codebase
nicolaslara acf1f50
remove test for same wasm files. No longer needed.
nicolaslara 4541b87
Merge branch 'main' into nicolas/ibc-rate-limit-middlware
nicolaslara f9ee22d
refactor based on code review
nicolaslara d9df73c
removed integration tests as they won't pass without integration
nicolaslara e681a7d
added params unit test
nicolaslara 9e14d15
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
nicolaslara 11a4957
Merge branch 'nicolas/ibc-rate-limit-middlware' into nicolas/ibc-rate…
nicolaslara 4fc7abb
reorganized tests
nicolaslara d2daad6
reorganizing tests
nicolaslara 24a3e2e
refactoring
nicolaslara 2095003
Merge branch 'main' into ibc-rate-limit
nicolaslara 65f0485
Merge branch 'ibc-rate-limit' into nicolas/ibc-rate-limit-integration…
nicolaslara 9240011
added address length limit
nicolaslara 0ca235b
Merge branch 'nicolas/ibc-receiver-field-cap' into ibc-rate-limit
nicolaslara 71d60b8
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
nicolaslara 69b4954
added tests and fixed lack of return
nicolaslara 21e7f51
Merge branch 'ibc-rate-limit' into nicolas/ibc-rate-limit-integration…
nicolaslara a78c757
remove tests from bad merge
nicolaslara 93413be
remove from bad merge again
nicolaslara 29f61fd
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
nicolaslara 7b79685
comment
nicolaslara 08a1cd8
test helpers for cosmwasm contracts
nicolaslara 27ee3ee
added helpers for ibctesting
nicolaslara 8c36532
comments
nicolaslara d125dbd
Merge branch 'nicolas/test-helpers' into nicolas/ibc-rate-limit-integ…
nicolaslara cc42cab
removed unnecessary txConfig
nicolaslara 41b3cae
fixed typos
nicolaslara 0ad0a90
clearer comment
nicolaslara 7b50cb4
using second helper function for ExportGenesis
nicolaslara 40f8cc6
Merge branch 'nicolas/export_for_modules' into nicolas/ibc-rate-limit…
nicolaslara e7798a1
added new wasm file
nicolaslara 88b1c4a
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
nicolaslara f58e267
updated the contract to cosmwasm 1.1 and Uint256 for amounts
nicolaslara 032f33b
Fixed send with ibc assets. Better tests and error messages
nicolaslara f107877
updated contract with x86 version
nicolaslara 237f144
gofumpt
nicolaslara caad1f2
fixed clippy errors
nicolaslara 13f2621
using the escrowed value as the channel value for native tokens
nicolaslara 79109a2
gofumpt
nicolaslara 60811cf
update fail string
nicolaslara c50cf10
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
nicolaslara f3fb41d
initial experiments with moving the calculations into the contract
nicolaslara f3ffd4a
initial experiments with using the packet inside the contract
nicolaslara 280382f
improved tests. Experiments with packet in the contract.
nicolaslara a843646
original contract
nicolaslara 4f66cb1
cleaner tests
nicolaslara eac58d5
more test cleanup
nicolaslara 68e007b
cleaner tests
nicolaslara 2f932b5
Merge branch 'nicolas/ibc-rate-limit-contract-updates' into nicolas/i…
nicolaslara 3e1539e
cleanup
nicolaslara 952a2e6
Merge branch 'main' into nicolas/ibc-rate-limit-integration-and-tests
ValarDragon ef94442
align values from the tests and the contract
nicolaslara a80d964
fixed amounts for receive and cleanup code
nicolaslara e9a4d52
removed redundant wrapping logic
nicolaslara c2caa5c
adaped failed send test to the new testing abstractions
nicolaslara 60330ea
only manipulate time on chain A
nicolaslara cd96c4d
Merge branch 'nicolas/ibc-rate-limit-integration-and-tests' into nico…
nicolaslara f2429dc
remove commented out block
nicolaslara 719fd38
changed lints to stable so they change less often
nicolaslara 80d04fd
gofumpt
nicolaslara 976a672
update channel value tests
nicolaslara 3ae7c43
Merge branch 'nicolas/cosmwasm-lints-2' into nicolas/ibc-rate-limit/n…
nicolaslara 503011e
added x86 version of the contract for ci
nicolaslara 49aa140
remove lint type that doesn't exist on stable
nicolaslara caf51cf
get the channel value across all channels for native assets
nicolaslara 67dad2f
Merge branch 'main' into nicolas/ibc-rate-limit/channel-value-across-…
nicolaslara cdb75b2
gofumpt
nicolaslara 6b0a6f3
temporarily using the whole supply for native tokens for performance …
nicolaslara 958fdd7
fix expiration tests to to not use reduced value
nicolaslara 4c599ba
filtering native tokens across all channels
nicolaslara f78273a
updated bytecode to x86
nicolaslara a5bbd6a
Merge branch 'nicolas/ibc-rate-limit/channel-value-across-channels' i…
nicolaslara 2f7d53d
updated contract interface to use the packet.
nicolaslara 86adee8
passing the packet down to the contract
nicolaslara 1751920
Merge branch 'main' into nicolas/ibc-rate-limit/optional-packet
nicolaslara d48cc61
Added cosmwasm_1_1 capability
nicolaslara 84ad5a3
fetching the channel value from the chain
nicolaslara e6f8112
making "any" channels automatic and not dependent on the denom type
nicolaslara be63898
moved the channel value calculation and denom parsing to the contract
nicolaslara 1d8f26c
cleanup. Removed unecessary code
nicolaslara f742674
Merge branch 'main' into nicolas/ibc-rate-limit/channel-any
nicolaslara 5bd6019
Merge branch 'nicolas/ibc-rate-limit/channel-any' into nicolas/ibc-ra…
nicolaslara 7795fbd
fixed lints
nicolaslara be7a2a8
use proper query for e2e tests
nicolaslara d671682
fixed type
nicolaslara 9050b4d
using the interface where possible
nicolaslara 513ae8d
using the new error string
nicolaslara 400f43c
go fumpt
nicolaslara 2e50216
using the x86 bytecode
nicolaslara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanity checking, cosmwasm 1.1 won't break anything existing right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://medium.com/cosmwasm/cosmwasm-1-1-14233baf8162
Perfect! (though if 1.1 runs on 1.0 hosts, I don't really understand why its feature flagged?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just makes the feature available so that if someone compiles their contract with 1.1, then the 1.1 features from cosmwasm_std and whatever they feature-gate in their contract will be available.
The version of wasmd we're on should already support cosmwasm_1.1