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

feat: ADR-004: Application links expiration time #723

Merged
merged 121 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
d53e53b
- implemented expiration time for app links
leobragaz Jan 17, 2022
01991f4
- completed appLinksParams implementation
leobragaz Jan 17, 2022
e4b68b7
- added tests for expiring links
leobragaz Jan 18, 2022
5d4d03a
fixed proto file lint error
leobragaz Jan 19, 2022
85bdf16
reviewed migration code
leobragaz Jan 19, 2022
edb7793
added migrations tests (need to fix some)
leobragaz Jan 19, 2022
dfe9eba
fixed migration errors
leobragaz Jan 20, 2022
fd1a7df
fixed params name in order to fix lint
leobragaz Jan 21, 2022
1328c82
- switched from time.Time to time.Duration for
leobragaz Jan 21, 2022
1ef5251
- added benchmark test for expired links deletion
leobragaz Jan 21, 2022
39449c6
fixed params migration
leobragaz Jan 24, 2022
054e230
revert keeper's StoreKey and Cdc exports
leobragaz Jan 24, 2022
450d091
revert unwanted changes in chain links file
leobragaz Jan 24, 2022
7cd38b4
fixed params migration test
leobragaz Jan 24, 2022
ece318d
added changeset entry
leobragaz Jan 24, 2022
f3f8ca3
edited genesis state link for on-chain-upgrade test
leobragaz Jan 24, 2022
60b7917
added some lines to IterateExpiringLinks test to cover a missing case
leobragaz Jan 24, 2022
427a9f4
updated on-chain-upgrade workflow with mainnet state
leobragaz Jan 25, 2022
5c64fbf
trying on-chain upgrade
leobragaz Jan 25, 2022
c72eedf
trying the fix for on-chain-upgrade test by
leobragaz Jan 25, 2022
7651f7e
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
leobragaz Jan 25, 2022
3b0423b
added missing BUILD_TAGS in Makefile
leobragaz Jan 25, 2022
95d129d
fix last commit with BUILD_FLAGS in Makefile
leobragaz Jan 25, 2022
d0732e5
removed wrong flag from build-linux cmd
leobragaz Jan 25, 2022
19913ba
trying add the muslc directly in the build-linux cmd
leobragaz Jan 25, 2022
677f675
adding the static wasmvm library
leobragaz Jan 25, 2022
4864180
Revert "adding the static wasmvm library"
leobragaz Jan 25, 2022
ead0d98
adding the static wasmvm library
leobragaz Jan 25, 2022
7e00710
adding the static wasmvm library
leobragaz Jan 25, 2022
82fb64e
Revert "adding the static wasmvm library"
leobragaz Jan 25, 2022
c017bf7
Revert "adding the static wasmvm library"
leobragaz Jan 25, 2022
39a504b
download the static library in start.sh
leobragaz Jan 25, 2022
9d68bce
added sudo rights
leobragaz Jan 25, 2022
4f2161f
fixing static lib download
leobragaz Jan 25, 2022
356838c
tried to link the wasmvm static library in makefile
leobragaz Jan 25, 2022
bb922e5
edit start.sh to handle the download and check of static libraries
leobragaz Jan 26, 2022
d0d8d6e
removed wrong flag for linking static library
leobragaz Jan 26, 2022
b12d853
fixed building errors
leobragaz Jan 26, 2022
287f3f3
Revert "fixed building errors"
leobragaz Jan 26, 2022
f8f4a56
Revert "removed wrong flag for linking static library"
leobragaz Jan 26, 2022
011a71d
Revert "edit start.sh to handle the download and check of static libr…
leobragaz Jan 26, 2022
fbec69a
Revert "tried to link the wasmvm static library in makefile"
leobragaz Jan 26, 2022
d3d1e9c
removed wrong flag for linking static libraries
leobragaz Jan 26, 2022
4a3893b
removed static lib download from start.sh
leobragaz Jan 26, 2022
630db00
removed flag from build-linux cmd
leobragaz Jan 26, 2022
34255b6
trying fix missing libraries errors in on-chain-upgrade test
leobragaz Jan 26, 2022
dad645e
fixed error in submit_upgrade_proposal.sh
leobragaz Jan 26, 2022
89949ed
readded muslc flag to build-linux
leobragaz Jan 26, 2022
ebb1059
updated upgradeHandler version to match that of subspace pr
leobragaz Jan 26, 2022
e82bcc0
removed muslc from makefile build-linux
leobragaz Jan 26, 2022
373f1aa
updated upgrade name in workflow
leobragaz Jan 27, 2022
15862dd
updated desmos-build Dockerfile to enable the usage of static library…
leobragaz Jan 27, 2022
13337d1
tried to edit start.sh make build command to enable precompiled libra…
leobragaz Jan 27, 2022
0b7a239
tried use another dockerfile with start.sh
leobragaz Jan 27, 2022
189adf1
Revert "tried use another dockerfile with start.sh"
leobragaz Jan 27, 2022
8f8375b
trying the new configuration of start.sh
leobragaz Jan 27, 2022
49f030d
trying the new configuration of start.sh
leobragaz Jan 27, 2022
449e218
edited wrong binary directory
leobragaz Jan 27, 2022
833415c
fixing docker compose image version
leobragaz Jan 27, 2022
5f800b8
added a new build-linux-muslc to use with setup-localnet
leobragaz Jan 28, 2022
f4eef42
removed muslc from build-linux
leobragaz Jan 28, 2022
20fa015
edited coin denom in setup-localnet Makefile
leobragaz Jan 28, 2022
beaf1dd
review code and applied PR review suggestions
leobragaz Jan 31, 2022
c5a50e7
reviewed how store test was written
leobragaz Feb 1, 2022
ca7a48b
trying to bypass the use of setup-localnet
leobragaz Feb 1, 2022
f5c76ea
try adding sudo before desmos testnet cmd
leobragaz Feb 1, 2022
9011213
applied pr reviewe suggestions
leobragaz Feb 2, 2022
8ecde9d
fixed sims tests
leobragaz Feb 2, 2022
14a7559
try fix the start.sh cmd with review suggestions
leobragaz Feb 4, 2022
a71adad
fixed missing " closure in start.sh
leobragaz Feb 4, 2022
0609d8b
fix errors in start.sh
leobragaz Feb 4, 2022
ae4c4a0
test script without UID to force root
leobragaz Feb 7, 2022
621434e
fixing dir in docker run cmd in start.sh
leobragaz Feb 7, 2022
bf4e66b
added chmod +x to solve permission denied errors
leobragaz Feb 7, 2022
51838d8
added chmod +x to solve permission denied errors
leobragaz Feb 7, 2022
e401ca9
added chmod +x in upgrade-testnet-start
leobragaz Feb 7, 2022
1ade38a
trying adding sudo to start.sh
leobragaz Feb 7, 2022
3191ec1
fixed coin denom checks
leobragaz Feb 7, 2022
24eaccd
edited docker desmos build directory
leobragaz Feb 7, 2022
c4292a7
added containers logs
leobragaz Feb 7, 2022
3ece866
prepend sudo to cosmovisor wrapper.sh script
leobragaz Feb 7, 2022
84bc648
trying to remove uid e gid to force root use
leobragaz Feb 7, 2022
56859a8
updated on-chain-upgrade.yml workflow exported state
leobragaz Feb 10, 2022
a228168
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
leobragaz Feb 17, 2022
efa4026
pulled master and fixed conflicts
leobragaz Feb 17, 2022
664d126
use udsm as default coin denom instead of udaric
leobragaz Feb 17, 2022
e646fd2
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
leobragaz Feb 22, 2022
57154d2
fixed conflicts with master branch
leobragaz Feb 22, 2022
13bd8e4
Updated Swagger definition
bragaz Feb 22, 2022
272c671
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
RiccardoM Mar 23, 2022
eaa9279
merged master
RiccardoM Mar 23, 2022
5852064
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
leobragaz Apr 12, 2022
d4d3953
fixed broken tests
leobragaz Apr 12, 2022
c17af26
Updated Swagger definition
bragaz Apr 12, 2022
d331889
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
RiccardoM Jul 8, 2022
d0bbd8e
revert: add benchmark tests
RiccardoM Jul 8, 2022
e522391
revert: change denom name
RiccardoM Jul 8, 2022
f8e13ce
revert: cosmovisor Dockerfile changes
RiccardoM Jul 8, 2022
bb4ba3e
removed useless logs from within the submit_upgrade_proposal script
RiccardoM Jul 8, 2022
84bfaac
updated Proto files
RiccardoM Jul 8, 2022
9248cb3
updated go package
RiccardoM Jul 8, 2022
c63d070
updated Proto files definitions
RiccardoM Jul 8, 2022
4bda50c
Updated Swagger definition
RiccardoM Jul 8, 2022
43990e0
fixed tests
RiccardoM Jul 8, 2022
9f66e6b
Updated Swagger definition
RiccardoM Jul 8, 2022
0e1e58d
improved tests
RiccardoM Jul 8, 2022
84ac02e
Merge remote-tracking branch 'origin/leonardo/application-links-expir…
RiccardoM Jul 8, 2022
1aba69b
fixed small formatting
RiccardoM Jul 8, 2022
355f21d
updated the migrations
RiccardoM Jul 8, 2022
3dccdc2
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
RiccardoM Jul 14, 2022
1cd567c
test: fixed test sample of chain link cmd
dadamu Jul 14, 2022
7e8cc9c
fixed unit tests
RiccardoM Jul 14, 2022
5048d56
Merge branch 'master' of github.com:desmos-labs/desmos into leonardo/…
RiccardoM Jul 15, 2022
189cfe1
updated ADR status
RiccardoM Jul 15, 2022
f002354
slightly changed ADR
RiccardoM Jul 15, 2022
d41df0c
added missing comments
RiccardoM Jul 15, 2022
95d22af
move benchmark tests
RiccardoM Jul 15, 2022
628932d
fixed migration version comments
RiccardoM Jul 15, 2022
25ced70
improved migration comments
RiccardoM Jul 15, 2022
f23948e
Update x/profiles/legacy/v6/store_test.go
RiccardoM Jul 15, 2022
cd41847
Update x/profiles/legacy/v6/store_test.go
RiccardoM Jul 15, 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
42 changes: 42 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Benchmarks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow uses benchstat a common go tool for comparing different benchmarks results.
In our case, the workflow will compare the master branch benchmark's result with the ones of a new PR which is IMO very useful to let us understand if we have introduced a performance regression.
In order to make this properly working, bench tests should be written when we consider it's the case.

on:
pull_request:
push:
branches:
- master
env:
GO111MODULE: "on"
jobs:
Benchmarks:
runs-on: ubuntu-latest
steps:
- name: Setup Go 🧰
uses: actions/[email protected]
with:
go-version: 1.15

- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Go cache 💾
uses: actions/cache@v2
with:
path: ~/go/pkg
key: ${{ runner.os }}-go-pkg-${{ hashFiles('**/go.mod') }}

- name: Restore benchstat 🪛
uses: actions/[email protected]
with:
path: ~/go/bin/benchstat
key: ${{ runner.os }}-benchstat

- name: Restore base benchmark result 📝
uses: actions/cache@v2
with:
path: |
bench-master.txt
# Using base sha for PR or new commit hash for master/main push in benchmark result key.
key: ${{ runner.os }}-bench-${{ (github.event.pull_request.base.sha != github.event.after) && github.event.pull_request.base.sha || github.event.after }}

- name: Benchmark 🧮
run: REF_NAME=${GITHUB_REF##*/} make benchmark
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ MOCKS_DIR = $(CURDIR)/tests/mocks
HTTPS_GIT := https://github.com/desmos-labs/desmos.git
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
BENCH_COUNT ?= 5
REF_NAME ?= $(shell git symbolic-ref HEAD --short | tr / - 2>/dev/null)

export GO111MODULE = on

Expand Down Expand Up @@ -251,7 +253,9 @@ test-cover:
.PHONY: test-cover

benchmark:
@go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)
@go test -mod=readonly -bench=. -count=$(BENCH_COUNT) -run=^a ./... >bench-$(REF_NAME).txt
@test -s $(GOPATH)/bin/benchstat || GO111MODULE=off GOFLAGS= GOBIN=$(GOPATH)/bin go get -u golang.org/x/perf/cmd/benchstat
@test -e bench-master.txt && benchstat bench-master.txt bench-$(REF_NAME).txt || benchstat bench-$(REF_NAME).txt
.PHONY: benchmark

###############################################################################
Expand Down
7 changes: 0 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0=
github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -860,10 +859,7 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9
github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM=
github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
Expand Down Expand Up @@ -1158,11 +1154,9 @@ golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1265,7 +1259,6 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b h1:SXy8Ld8oKlcogOvUAh0J5Pm5RKzgYBMMxLxt6n5XW50=
golang.org/x/net v0.0.0-20211005001312-d4b1ae081e3b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
Expand Down
155 changes: 155 additions & 0 deletions proto/desmos/profiles/legacy/v200/models_app_links.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
syntax = "proto3";
package desmos.profiles.legacy.v200;

option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why v200 but not v230? I think the legacy version should be the last version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it was since v2.0.0 that the appLinks had not been changed. So I thought they should belong to that particular version. Should we move this to v2.3.0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I thought it means the legacy appLink is available until v2.3.0. Then v2.3.0 chain link should be v2.1.0...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dadamu actually also your thought makes sense. @RiccardoM How should we handle legacy code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually looking into this problem inside #730 by reviewing where different things are located for legacy stuff and updates


import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";

// ApplicationLink contains the data of a link to a centralized application
message ApplicationLink {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = true;

// User to which the link is associated
string user = 1 [ (gogoproto.moretags) = "yaml:\"user\"" ];

// Data contains the details of this specific link
Data data = 2
[ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"data\"" ];

// State of the link
ApplicationLinkState state = 3 [ (gogoproto.moretags) = "yaml:\"state\"" ];

// OracleRequest represents the request that has been made to the oracle
OracleRequest oracle_request = 4 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"oracle_request\""
];

// Data coming from the result of the verification.
// Only available when the state is STATE_SUCCESS
Result result = 5 [ (gogoproto.moretags) = "yaml:\"result\"" ];

// CreationTime represents the time in which the link was created
google.protobuf.Timestamp creation_time = 6 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"creation_time\""
];
}

// Data contains the data associated to a specific user of a
// generic centralized application
message Data {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = true;

// The application name (eg. Twitter, GitHub, etc)
string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ];
// Username on the application (eg. Twitter tag, GitHub profile, etc)
string username = 2 [ (gogoproto.moretags) = "yaml:\"username\"" ];
}

// OracleRequest represents a generic oracle request used to
// verify the ownership of a centralized application account
message OracleRequest {
option (gogoproto.goproto_getters) = false;

option (gogoproto.equal) = true;

// ID is the ID of the request
uint64 id = 1
[ (gogoproto.customname) = "ID", (gogoproto.moretags) = "yaml:\"id\"" ];

// OracleScriptID is ID of an oracle script
uint64 oracle_script_id = 2 [
(gogoproto.customname) = "OracleScriptID",
(gogoproto.moretags) = "yaml:\"oracle_script_id\""
];

// CallData contains the data used to perform the oracle request
CallData call_data = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"call_data\""
];

// ClientID represents the ID of the client that has called the oracle script
string client_id = 4 [
(gogoproto.customname) = "ClientID",
(gogoproto.moretags) = "yaml:\"client_id\""
];

// CallData contains the data sent to a single oracle request in order to
// verify the ownership of a centralized application by a Desmos profile
message CallData {
option (gogoproto.equal) = true;

// The application for which the ownership should be verified
string application = 1 [ (gogoproto.moretags) = "yaml:\"application\"" ];

// The hex encoded call data that should be used to verify the application
// account ownership
string call_data = 2 [ (gogoproto.moretags) = "yaml:\"call_data\"" ];
}
}

// ApplicationLinkState defines if an application link is in the following
// states: STARTED, ERRORED, SUCCESSFUL, TIMED_OUT
enum ApplicationLinkState {
option (gogoproto.goproto_enum_prefix) = false;

// A link has just been initialized
APPLICATION_LINK_STATE_INITIALIZED_UNSPECIFIED = 0
[ (gogoproto.enumvalue_customname) = "ApplicationLinkStateInitialized" ];
// A link has just started being verified
APPLICATION_LINK_STATE_VERIFICATION_STARTED = 1
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationStarted" ];
// A link has errored during the verification process
APPLICATION_LINK_STATE_VERIFICATION_ERROR = 2
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationError" ];
// A link has being verified successfully
APPLICATION_LINK_STATE_VERIFICATION_SUCCESS = 3
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationSuccess" ];
// A link has timed out while waiting for the verification
APPLICATION_LINK_STATE_TIMED_OUT = 4
[ (gogoproto.enumvalue_customname) = "AppLinkStateVerificationTimedOut" ];
}

// Result represents a verification result
message Result {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = true;

// sum is the oneof that specifies whether this represents a success or
// failure result
oneof sum {
// Success represents a successful verification
Success success = 1;

// Failed represents a failed verification
Failed failed = 2;
}

// Success is the result of an application link that has been successfully
// verified
message Success {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = true;

// Hex-encoded value that has be signed by the profile
string value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ];
// Hex-encoded signature that has been produced by signing the value
string signature = 2 [ (gogoproto.moretags) = "yaml:\"signature\"" ];
}

// Failed is the result of an application link that has not been verified
// successfully
message Failed {
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = true;

// Error that is associated with the failure
string error = 1 [ (gogoproto.moretags) = "yaml:\"error\"" ];
}
}
117 changes: 117 additions & 0 deletions proto/desmos/profiles/legacy/v200/models_params.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
syntax = "proto3";
package desmos.profiles.legacy.v200;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/desmos-labs/desmos/v2/x/profiles/legacy/v200";

// Params contains the parameters for the profiles module
message Params {
option (gogoproto.goproto_getters) = false;

NicknameParams nickname = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"nickname\""
];

DTagParams dtag = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"dtag\"",
(gogoproto.customname) = "DTag"
];

BioParams bio = 3
[ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"bio\"" ];

OracleParams oracle = 4 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"oracle\""
];
}

// NicknameParams defines the parameters related to the profiles nicknames
message NicknameParams {
option (gogoproto.goproto_getters) = false;

bytes min_length = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"min_length\""
];

bytes max_length = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"max_length\""
];
}

// DTagParams defines the parameters related to profile DTags
message DTagParams {
option (gogoproto.goproto_getters) = false;

string reg_ex = 1 [ (gogoproto.moretags) = "yaml:\"reg_ex\"" ];

bytes min_length = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"min_length\"",
(gogoproto.customname) = "MinLength"
];

bytes max_length = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"max_length\"",
(gogoproto.customname) = "MaxLength"
];
}

// BioParams defines the parameters related to profile biography
message BioParams {
option (gogoproto.goproto_getters) = false;

bytes max_length = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"max_length\""
];
}

// OracleParams defines the parameters related to the oracle
// that will be used to verify the ownership of a centralized
// application account by a Desmos profile
message OracleParams {
option (gogoproto.goproto_getters) = false;

// ScriptID represents the ID of the oracle script to be called to verify the
// data
uint64 script_id = 1 [
(gogoproto.customname) = "ScriptID",
(gogoproto.moretags) = "yaml:\"script_id\""
];

// AskCount represents the number of oracles to which ask to verify the data
uint64 ask_count = 2 [ (gogoproto.moretags) = "yaml:\"ask_count\"" ];

// MinCount represents the minimum count of oracles that should complete the
// verification successfully
uint64 min_count = 3 [ (gogoproto.moretags) = "yaml:\"min_count\"" ];

// PrepareGas represents the amount of gas to be used during the preparation
// stage of the oracle script
uint64 prepare_gas = 4 [ (gogoproto.moretags) = "yaml:\"prepare_gas\"" ];

// ExecuteGas represents the amount of gas to be used during the execution of
// the oracle script
uint64 execute_gas = 5 [ (gogoproto.moretags) = "yaml:\"execute_gas\"" ];

// FeeAmount represents the amount of fees to be payed in order to execute the
// oracle script
repeated cosmos.base.v1beta1.Coin fee_amount = 6 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "yaml:\"fee_amount\""
];
}
7 changes: 7 additions & 0 deletions proto/desmos/profiles/v1beta1/models_app_links.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ message ApplicationLink {
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"creation_time\""
];

// ExpirationTime represents the time in which the link will expire
google.protobuf.Timestamp expiration_time = 7 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"expiration_time\""
];
}

// Data contains the data associated to a specific user of a
Expand Down
Loading