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

x/gravity: refactor state #319

Closed
wants to merge 81 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c468002
define api
tac0turtle Mar 15, 2021
8e9fade
define claims and confirms
tac0turtle Mar 15, 2021
d307e6b
interfaces
tac0turtle Mar 15, 2021
9d56880
regenerate proto stubs
tac0turtle Mar 22, 2021
ea62a84
define claim handler, fix cli/tx.go
tac0turtle Mar 23, 2021
ec02649
claims
tac0turtle Mar 24, 2021
d1fe57c
Merge branch 'refactor' into marko/api_any
tac0turtle Mar 24, 2021
7fac6ff
debug tests
tac0turtle Mar 24, 2021
35b2be5
fix error and confirm submisison
tac0turtle Mar 25, 2021
da9da06
fix naming
tac0turtle Mar 25, 2021
b6b72f1
x/gravity: state refactor
fedekunze Apr 4, 2021
380409d
new state (wip)
fedekunze Apr 7, 2021
992a758
pool and batch (wip)
fedekunze Apr 8, 2021
06cad68
refactor batch
fedekunze Apr 8, 2021
df951d0
abci and slash refactor (wip)
fedekunze Apr 8, 2021
fd60831
Merge branch 'refactor' into marko/api_any
tac0turtle Apr 10, 2021
3c3ed6f
regen proto
Apr 10, 2021
008ba10
logic call, eth signer set and attestation handler (wip)
fedekunze Apr 12, 2021
d72b636
update proto and attestations
fedekunze Apr 12, 2021
7fc0bfb
proto docs (wip)
fedekunze Apr 12, 2021
a5509a6
wip
fedekunze Apr 12, 2021
31c3660
bump sdk and tendermint versions
fedekunze Apr 13, 2021
14bb3d3
additional keeper cleanup
fedekunze Apr 14, 2021
522f810
fix conflicts
fedekunze Apr 15, 2021
83980a7
types changes
fedekunze Apr 15, 2021
fb60d4e
update types
fedekunze Apr 15, 2021
e496224
wip types
fedekunze Apr 16, 2021
3101404
proto changes
fedekunze Apr 16, 2021
bdd9f6b
type refactor (wip)
fedekunze Apr 16, 2021
5b9533e
conflicts
fedekunze Apr 19, 2021
f621018
update batches
fedekunze Apr 19, 2021
4165751
tx id as HexBytes
fedekunze Apr 19, 2021
a2a2f6c
keeper: prefix and hashes
fedekunze Apr 19, 2021
38115e9
rm old keeper
fedekunze Apr 19, 2021
b960c90
batch cleanup
fedekunze Apr 20, 2021
5135c88
cleanup Endblock and slashing
fedekunze Apr 21, 2021
3d9c425
rm CLI and fix RegisterERC20
fedekunze Apr 21, 2021
3f4586f
proto fixes
fedekunze Apr 22, 2021
a208908
update attestation callbacks
fedekunze Apr 26, 2021
175ded2
fix proto
fedekunze Apr 26, 2021
9f2f736
initial tests
mvid Apr 26, 2021
460b37e
Merge branch 'fedekunze/state' of github.com:cosmos/gravity-bridge in…
mvid Apr 26, 2021
bfd46c6
initial denom validation tests
mvid Apr 26, 2021
664c3d0
update error messages
fedekunze Apr 27, 2021
a8d804b
minor proto and checkpoint changes
fedekunze Apr 27, 2021
bb70046
fix signer set
fedekunze Apr 27, 2021
e6715be
types validation
fedekunze Apr 28, 2021
eec507f
update confirm
fedekunze Apr 28, 2021
914119b
signer set confirm
fedekunze Apr 28, 2021
695f51e
raw init and export genesis
fedekunze Apr 28, 2021
0cd1801
Merge branch 'fedekunze/state' of github.com:cosmos/gravity-bridge in…
mvid Apr 28, 2021
3d425fd
params and denom tests
mvid Apr 28, 2021
cfcd842
initial msgs tests
mvid Apr 28, 2021
adb59f7
failing confirm tests
mvid Apr 28, 2021
b59134f
packing for any
mvid Apr 28, 2021
1b8e3cd
test example
fedekunze Apr 29, 2021
38e2997
set confirm
fedekunze Apr 29, 2021
7b0f2a0
fixed 'any' tests
mvid Apr 29, 2021
2f1bf44
merge
mvid Apr 29, 2021
9567721
test update
mvid Apr 29, 2021
0b30bbf
event tests
mvid Apr 29, 2021
2f3147e
basic genesis state test
mvid Apr 29, 2021
a51b4ec
Add docs for Relaying ETH to Cosmos
jkilpatr Apr 12, 2021
3cb9a21
Add relayer semantics doc
jkilpatr Apr 13, 2021
ad1fe6d
Override localhost in the test runner with environment variable to en…
zmanian Apr 28, 2021
93931d2
initial keeper tests
mvid Apr 29, 2021
3af376e
Merge branch 'fedekunze/state' of github.com:cosmos/gravity-bridge in…
mvid Apr 29, 2021
a774e9b
remove unused arg
mvid Apr 29, 2021
550cfa4
short circuit if gravity node is down
mvid Apr 29, 2021
41a004a
keeper setup
fedekunze Apr 30, 2021
51022bc
fix events
fedekunze Apr 30, 2021
e75c1db
slashing
fedekunze Apr 30, 2021
7cc848e
minor cleanup
fedekunze Apr 30, 2021
8aef3ba
rm transfer tx from batch (wip)
fedekunze Apr 30, 2021
d06441a
keeper tests
mvid Apr 30, 2021
15cf910
Merge branch 'fedekunze/state' of github.com:cosmos/gravity-bridge in…
mvid Apr 30, 2021
0fd4806
attestation and genesis fixes
fedekunze May 3, 2021
cd48f45
Merge branch 'fedekunze/state' of github.com:cosmos/gravity-bridge in…
fedekunze May 3, 2021
74a14d4
genesis wip
fedekunze May 3, 2021
ed24035
Push wip work from pairing
jackzampolin May 3, 2021
3c37256
WIP pairing
jackzampolin May 3, 2021
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
10 changes: 2 additions & 8 deletions module/contrib/local/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ for dir in $proto_dirs; do
-I "third_party/proto" \
--gocosmos_out=plugins=interfacetype+grpc,\
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
--grpc-gateway_out=logtostderr=true:. \
$(find "${dir}" -maxdepth 1 -name '*.proto')

# # command to generate gRPC gateway (*.pb.gw.go in respective modules) files
# buf protoc \
# -I "proto" \
# -I "third_party/proto" \
# --grpc-gateway_out=logtostderr=true:. \
# $(find "${dir}" -maxdepth 1 -name '*.proto')


done

# move proto files to the right places
Expand Down
1 change: 1 addition & 0 deletions module/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1
github.com/spf13/cast v1.3.1
github.com/spf13/cobra v1.1.1
github.com/spf13/viper v1.7.1
Expand Down
11 changes: 0 additions & 11 deletions module/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/cosmos/gravity-bridge/module v0.0.0-20210322173118-25d77b5f9b46 h1:XXCzKCfiWWnn6sjNISC/pv+GbfEd03bCpu0IXCnS9TA=
github.com/cosmos/gravity-bridge/module v0.0.0-20210322173118-25d77b5f9b46/go.mod h1:jEI1pLV70xW9prKdBnKroKWIpYXjcVyn4BQQcwXHs40=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
Expand Down Expand Up @@ -133,7 +131,6 @@ github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXy
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE=
github.com/cosmos/iavl v0.15.0-rc5 h1:AMKgaAjXwGANWv56NL4q4hV+a0puSkLYD6cCQAv3i44=
github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I=
github.com/cosmos/iavl v0.15.3 h1:xE9r6HW8GeKeoYJN4zefpljZ1oukVScP/7M8oj6SUts=
github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4=
Expand Down Expand Up @@ -565,7 +562,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y=
github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10=
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4=
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
Expand Down Expand Up @@ -622,7 +618,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand All @@ -640,12 +635,10 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4=
github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg=
github.com/tendermint/tendermint v0.34.0 h1:eXCfMgoqVSzrjzOj6clI9GAejcHH0LvOlRjpCmMJksU=
github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ=
github.com/tendermint/tendermint v0.34.8 h1:PMWgUx47FrNTsfhxCWzoiIlVAC1SE9+WBlnsF9oQW0I=
github.com/tendermint/tendermint v0.34.8/go.mod h1:JVuu3V1ZexOaZG8VJMRl8lnfrGw6hEB2TVnoUwKRbss=
github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI=
github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg=
github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8=
github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ=
github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw=
Expand Down Expand Up @@ -697,7 +690,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
Expand Down Expand Up @@ -873,7 +865,6 @@ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6 h1:iRN4+t0lvZX/l9gH14ARF9i58tsVa5a97k6aH95rC3Y=
google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f h1:izedQ6yVIc5mZsRuXzmSreCOlzI0lCU1HpG8yEdMiKw=
Expand All @@ -897,7 +888,6 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
Expand Down Expand Up @@ -939,7 +929,6 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Expand Down
56 changes: 37 additions & 19 deletions module/proto/gravity/v1/batch.proto
Original file line number Diff line number Diff line change
@@ -1,33 +1,51 @@
syntax = "proto3";
package gravity.v1;

import "gravity/v1/attestation.proto";
// import "gravity/v1/types.proto";

option go_package = "github.com/cosmos/gravity-bridge/module/x/gravity/types";

// OutgoingTxBatch represents a batch of transactions going from gravity to ETH
message OutgoingTxBatch {
uint64 batch_nonce = 1;
uint64 batch_timeout = 2;
repeated OutgoingTransferTx transactions = 3;
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";

// BatchTx represents a batch of transactions going from Cosmos to Ethereum
message BatchTx {
uint64 nonce = 1;
uint64 timeout = 2;
repeated TransferTx transactions = 3 [(gogoproto.nullable) = false];
string token_contract = 4;
uint64 block = 5;
}

// OutgoingTransferTx represents an individual send from gravity to ETH
message OutgoingTransferTx {
uint64 id = 1;
string sender = 2;
string dest_address = 3;
ERC20Token erc20_token = 4;
ERC20Token erc20_fee = 5;
// TransferTx represents an individual transfer from Cosmos to Ethereum
message TransferTx {
// cosmos account address of the sender in bech32 format
string sender = 1;
// ethereum recipient address in hex format
string ethereum_recipient = 2;
// amount of the transfer represented as an sdk.Coin. The coin denomination
// must correspond to a valid ERC20 token contract address
cosmos.base.v1beta1.Coin erc20_token = 3 [
(gogoproto.nullable) = false
];
// transfer fees for the bridge orchestrators, represented as an sdk.Coin.
// The coin denomination must correspond to a valid ERC20 token contract address
cosmos.base.v1beta1.Coin erc20_fee = 4 [
(gogoproto.nullable) = false
];
}

// OutgoingLogicCall represents an individual logic call from gravity to ETH
message OutgoingLogicCall {
repeated ERC20Token transfers = 1;
repeated ERC20Token fees = 2;
// LogicCallTx represents an individual arbitratry logic call transaction from
// Cosmos to Ethereum.
message LogicCallTx {
// erc20 tokens represented as sdk.Coins
repeated cosmos.base.v1beta1.Coin tokens = 1 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// erc20 tokens represented as sdk.Coins used as fees for the bridge orchestrators.
repeated cosmos.base.v1beta1.Coin fees = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
string logic_contract_address = 3;
bytes payload = 4;
uint64 timeout = 5;
Expand Down
66 changes: 66 additions & 0 deletions module/proto/gravity/v1/claims.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
syntax = "proto3";
package gravity.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/gravity-bridge/module/x/gravity/types";

enum ClaimType {
CLAIM_TYPE_UNSPECIFIED = 0;
CLAIM_TYPE_DEPOSIT = 1;
CLAIM_TYPE_WITHDRAW = 2;
CLAIM_TYPE_ERC20_DEPLOYED = 3;
CLAIM_TYPE_LOGIC_CALL_EXECUTED = 4;
}

// EthereumBridgeDepositClaim
// When more than 66% of the active validator set has
// claimed to have seen the deposit enter the ethereum blockchain coins are
// issued to the Cosmos address in question
// -------------
message DepositClaim {
uint64 event_nonce = 1;
uint64 block_height = 2;
string token_contract = 3;
string amount = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
string ethereum_sender = 5;
string cosmos_receiver = 6;
string orchestrator_address = 7;
}

// WithdrawClaim claims that a batch of withdrawal
// operations on the bridge contract was executed.
message WithdrawClaim {
uint64 event_nonce = 1;
uint64 block_height = 2;
uint64 batch_nonce = 3;
string token_contract = 4;
string orchestrator_address = 5;
}

// This informs the Cosmos module that a logic
// call has been executed
message LogicCallExecutedClaim {
uint64 event_nonce = 1;
uint64 block_height = 2;
bytes invalidation_id = 3;
uint64 invalidation_nonce = 4;
string orchestrator_address = 5;
}

// ERC20DeployedClaim allows the Cosmos module
// to learn about an ERC20 that someone deployed
// to represent a Cosmos asset
message ERC20DeployedClaim {
uint64 event_nonce = 1;
uint64 block_height = 2;
string cosmos_denom = 3;
string token_contract = 4;
string name = 5;
string symbol = 6;
uint64 decimals = 7;
string orchestrator_address = 8;
}
66 changes: 66 additions & 0 deletions module/proto/gravity/v1/confirm.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
syntax = "proto3";
package gravity.v1;

option go_package = "github.com/cosmos/gravity-bridge/module/x/gravity/types";

// ConfirmType is the cosmos type of a confirmation of a given object from the eth signers
enum ConfirmType {
CONFIRM_TYPE_UNSPECIFIED = 0;
CONFIRM_TYPE_VALSET = 1;
CONFIRM_TYPE_BATCH = 2;
CONFIRM_TYPE_LOGIC = 3;
}

// ConfirmLogicCall
// When validators observe a MsgRequestBatch they form a batch by ordering
// transactions currently in the txqueue in order of highest to lowest fee,
// cutting off when the batch either reaches a hardcoded maximum size (to be
// decided, probably around 100) or when transactions stop being profitable
// (TODO determine this without nondeterminism) This message includes the batch
// as well as an Ethereum signature over this batch by the validator
// -------------
message ConfirmLogicCall {
string invalidation_id = 1;
uint64 invalidation_nonce = 2;
string eth_signer = 3;
string orchestrator_address = 4;
string signature = 5;
}

// ConfirmBatch
// When validators observe a MsgRequestBatch they form a batch by ordering
// transactions currently in the txqueue in order of highest to lowest fee,
// cutting off when the batch either reaches a hardcoded maximum size (to be
// decided, probably around 100) or when transactions stop being profitable
// (TODO determine this without nondeterminism) This message includes the batch
// as well as an Ethereum signature over this batch by the validator
// -------------
message ConfirmBatch {
uint64 nonce = 1;
string token_contract = 2;
string eth_signer = 3;
string orchestrator_address = 4;
string signature = 5;
}

// ValsetConfirm
// this is the message sent by the validators when they wish to submit their
// signatures over the validator set at a given block height. A validator must
// first call MsgSetEthAddress to set their Ethereum address to be used for
// signing. Then someone (anyone) must make a ValsetRequest, the request is
// essentially a messaging mechanism to determine which block all validators
// should submit signatures over. Finally validators sign the validator set,
// powers, and Ethereum addresses of the entire validator set at the height of a
// ValsetRequest and submit that signature with this message.
//
// If a sufficient number of validators (66% of voting power) (A) have set
// Ethereum addresses and (B) submit ValsetConfirm messages with their
// signatures it is then possible for anyone to view these signatures in the
// chain store and submit them to Ethereum to update the validator set
// -------------
message ValsetConfirm {
uint64 nonce = 1;
string orchestrator_address = 2;
string eth_address = 3;
string signature = 4;
}
2 changes: 2 additions & 0 deletions module/proto/gravity/v1/ethereum_signer.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
syntax = "proto3";
package gravity.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/gravity-bridge/module/x/gravity/types";

// SignType defines messages that have been signed by an orchestrator
Expand Down
Loading