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

Add Confidential Transfers Module #1980

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open

Add Confidential Transfers Module #1980

wants to merge 61 commits into from

Conversation

mj850
Copy link
Contributor

@mj850 mj850 commented Dec 7, 2024

Describe your changes and provide context

This is the working branch for adding the Confidential Transfers module.

Testing performed to validate your change

Associated unit and integration tests have been added here.

dssei and others added 30 commits December 6, 2024 17:39
* scaffolding for new module

* keeper scaffolding

* scaffold with types

* go sum

* comments pt1

* comments

* drop prev580
* pending balance type

* convert apply pending balance to a message type

* close account type
* new types

* add deposit to msgs

* add import issues

* revert evm/params to old state

* withdraw with tests

* small changes

* refactor and add tests

* comment
* Genesis draft

* revert evm params

* revert evm params -2

* working simple test

* linting

* addressing linter errors

* remove creating address for now
* add genesis init/export tests

* refactor store

* confidential transfers queries

* working draft test

* more tests

* refactor tests

* all accounts query

* formatting

* add pagination to request/response

* update implementation to use paginated response instead

* formatting

* remove redundant param

* all accounts with denoms

* clean up commented code

* return GetAccount back to keeper

* formatting
* new types

* add deposit to msgs

* add import issues

* revert evm/params to old state

* withdraw with tests

* small changes

* refactor and add tests

* comment

* refactor initialize type

* types

* non module account types

* msg server methods with module accounts

* tests scaffold

* add msg server tests

* codeql

* test issues

* test improvements

* comments

* todo

* app
* basic cli and first draft command for ct module

* add second command draft

* draft of init account

* close account update

* lint errors
* update codec

* cleanup and queryies

* enable in module

* add other query

* fix bug

* fix lint

* add decryption query

* cleanup

* validate address

* comments

* rectify test failures

* speed up withdraw test

* make other tests slightly faster
* - fix ct account by address and denom REST query
- update swagger

* - regenerate with latest changes
- set module version to 1
dssei and others added 6 commits December 6, 2024 17:51
* add ct to load test framework

* comment out receiver account creation for now

* - add ct account population script
- add ct query client
- add 4 types of ct messages for load test

* - script updates

* - add error handling

* script updates

* formatting

* disable state writing for transfers

* add metrics

* Revert "add metrics"

This reverts commit a7814b1.

* self review fixes
* save

* backend tests passing

* test

* types test

* acl tests

* utils

* codeql

* lint
* save

* backend tests passing

* test

* types test

* acl tests

* utils

* codeql

* draft

* register subspace

* params disable

* add scaling gas

* update tests

* add tests for disable feature

* integration tests fees bump

* update close account test

* lint

* comments

* comments
* refactor ct cli to use coin format like e.g. 1usei

* update integration tests

* formatting

* update integration tests

* update integration tests - 2
* test new verifier

* update to prod version

* update cryptography version

* try optimize test

* add optimization

* small optimization
Comment on lines +183 to +186
go func() {
ch <- am.ExportGenesis(ctx, cdc)
close(ch)
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
Copy link

codecov bot commented Dec 7, 2024

Codecov Report

Attention: Patch coverage is 61.18048% with 1026 lines in your changes missing coverage. Please review.

Project coverage is 61.31%. Comparing base (893568d) to head (2b6bea0).

Files with missing lines Patch % Lines
x/confidentialtransfers/types/transfer.go 54.39% 145 Missing and 21 partials ⚠️
x/confidentialtransfers/types/zk.go 70.05% 102 Missing and 51 partials ⚠️
x/confidentialtransfers/types/msgs.go 70.17% 127 Missing and 6 partials ⚠️
.../confidentialtransfers/types/initialize_account.go 0.00% 104 Missing ⚠️
x/confidentialtransfers/keeper/msg_server.go 75.80% 60 Missing and 30 partials ⚠️
x/confidentialtransfers/types/withdraw.go 0.00% 87 Missing ⚠️
...nfidentialtransfers/types/apply_pending_balance.go 0.00% 69 Missing ⚠️
x/confidentialtransfers/types/ct_account.go 0.00% 66 Missing ⚠️
x/confidentialtransfers/types/account.go 0.00% 36 Missing ⚠️
x/confidentialtransfers/types/close_account.go 0.00% 27 Missing ⚠️
... and 7 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1980      +/-   ##
==========================================
- Coverage   61.35%   61.31%   -0.04%     
==========================================
  Files         263      283      +20     
  Lines       24349    26992    +2643     
==========================================
+ Hits        14940    16551    +1611     
- Misses       8297     9210     +913     
- Partials     1112     1231     +119     
Files with missing lines Coverage Δ
aclmapping/confidentialtransfers/mappings.go 100.00% <100.00%> (ø)
app/app.go 66.58% <100.00%> (+0.39%) ⬆️
x/confidentialtransfers/types/keys.go 100.00% <100.00%> (ø)
x/confidentialtransfers/utils/utils.go 100.00% <100.00%> (ø)
x/confidentialtransfers/types/cryptography.go 88.00% <88.00%> (ø)
x/confidentialtransfers/types/params.go 85.71% <85.71%> (ø)
x/confidentialtransfers/keeper/genesis.go 77.14% <77.14%> (ø)
x/confidentialtransfers/keeper/grpc_query.go 76.00% <76.00%> (ø)
x/confidentialtransfers/keeper/keeper.go 75.90% <75.90%> (ø)
x/confidentialtransfers/types/codec.go 36.36% <36.36%> (ø)
... and 11 more

... and 3 files with indirect coverage changes

dssei and others added 17 commits December 10, 2024 11:13
- update kryptology version
* - remove dead code
- add test for keys

* - basic test for transfer object

* - transfer invalid inputs

* - wrong private key test

* - refactor tests

* - refactor tests
- tests for createTransferPartyParams

* - add more checks to transfers

* - tests for VerifyTransferProofs

* - tests for VerifyTransferProofs

* fix tests
* change key devrivation

* hash again

* version

* issues

* types test

* add tests

* bump unit test timeout

* add fixed prefix before hashing denom

* mertge issues
* Consume gas before verifying range proof

* bump timeout

* uint64

* test issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants