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(bridge): implement the bridge relayer #191

Merged
merged 112 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
5e71bd7
bridge tests, WIP
cyberhorsey Oct 24, 2022
f858d87
wip on a relayer. golang backend syncing ethereum messages to a the d…
cyberhorsey Oct 25, 2022
d6ba6af
default provider
cyberhorsey Oct 25, 2022
e21292d
message processing/proof generation
cyberhorsey Oct 25, 2022
97fdc1a
wip
cyberhorsey Oct 26, 2022
401c8bc
abi types
cyberhorsey Oct 26, 2022
e856efe
web3 library for simpler ABI
cyberhorsey Oct 26, 2022
c6e92ea
rm unneeded deps
cyberhorsey Oct 27, 2022
c260c0d
wip...
cyberhorsey Oct 27, 2022
a18a65f
types
cyberhorsey Oct 27, 2022
88c2b8f
Merge branch 'main' into relayer
cyberhorsey Oct 27, 2022
848d1cd
refactor, cleanup
cyberhorsey Oct 27, 2022
b75ef05
handleEvent func
cyberhorsey Oct 27, 2022
80c7597
rf
cyberhorsey Oct 27, 2022
f1da966
comments
cyberhorsey Oct 27, 2022
dc2917b
wip
cyberhorsey Oct 27, 2022
761487f
Merge branch 'bridge_tests' into relayer
cyberhorsey Oct 27, 2022
2065b1f
whole lotta WIP...
cyberhorsey Oct 28, 2022
6008b91
remove test things
cyberhorsey Oct 28, 2022
e3d3eb4
wip tests + githubactions
cyberhorsey Oct 31, 2022
7124821
merge main
cyberhorsey Oct 31, 2022
57f9ad4
test/moving/renaming
cyberhorsey Oct 31, 2022
7501907
gha
cyberhorsey Oct 31, 2022
c5bbfe4
rlp encoding is a yes, everything else massive WIP and logging...
cyberhorsey Oct 31, 2022
52e6dc8
abi encoding + rlp encodng working and decoding, still reverting tho
cyberhorsey Nov 1, 2022
c222af9
cleanup
cyberhorsey Nov 1, 2022
7cabf96
rm console logs, add V1TaikoL2 bindings, try to see if message is ver…
cyberhorsey Nov 1, 2022
ee559e4
wip
cyberhorsey Nov 2, 2022
4a61b4b
refactor to separate servces
cyberhorsey Nov 2, 2022
2049247
block header test for proof
cyberhorsey Nov 2, 2022
2ceeb70
fix some tests
cyberhorsey Nov 2, 2022
3673ce6
Crosslayer => dest
cyberhorsey Nov 2, 2022
a06dc8b
logs, tests
cyberhorsey Nov 2, 2022
7c9e7c3
estimate gas
cyberhorsey Nov 2, 2022
0d3bf33
Merge branch 'main' into relayer
cyberhorsey Nov 3, 2022
fc74a64
add iHeaderSync to relayer
cyberhorsey Nov 3, 2022
45018a0
block hash
cyberhorsey Nov 4, 2022
3aef67d
block hash
cyberhorsey Nov 4, 2022
75d5348
message comes back received
cyberhorsey Nov 4, 2022
2852601
tests
cyberhorsey Nov 4, 2022
e2d46b5
storageproof test
cyberhorsey Nov 4, 2022
347cc56
signal proof encoding test
cyberhorsey Nov 4, 2022
5027a20
log cleanup
cyberhorsey Nov 4, 2022
4089b36
wip
cyberhorsey Nov 7, 2022
f3bdf47
default env
cyberhorsey Nov 7, 2022
28899fc
l1_taiko_addr
cyberhorsey Nov 7, 2022
6ce0e3f
tests
cyberhorsey Nov 7, 2022
82eaa8d
rm hardcoded block
cyberhorsey Nov 7, 2022
7edfc25
comment
cyberhorsey Nov 7, 2022
c3a5fa8
processing works!
cyberhorsey Nov 8, 2022
aa073c8
Update auto-generated docs
cyberhorsey Nov 8, 2022
62101c8
CLI args
cyberhorsey Nov 9, 2022
7f0a78a
merge main
cyberhorsey Nov 9, 2022
4fe828d
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 9, 2022
053f01b
remove temp bridge ui
cyberhorsey Nov 9, 2022
a344993
Update auto-generated docs
cyberhorsey Nov 9, 2022
608cb56
separate dependencies out to interfaces in prover
cyberhorsey Nov 9, 2022
770c4cd
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 9, 2022
1b9cb1f
Update auto-generated docs
cyberhorsey Nov 9, 2022
d9ffae4
tests
cyberhorsey Nov 9, 2022
1f3a159
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 9, 2022
62bd2c3
Update auto-generated docs
cyberhorsey Nov 9, 2022
8b34f65
sol lints
cyberhorsey Nov 9, 2022
8959e0f
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 9, 2022
d474ec0
Update auto-generated docs
cyberhorsey Nov 9, 2022
b33c77a
event FindAllByAddress
cyberhorsey Nov 9, 2022
8f58618
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 9, 2022
8350b4c
Update auto-generated docs
cyberhorsey Nov 9, 2022
1206781
Update packages/protocol/test/test_integration.sh
cyberhorsey Nov 10, 2022
b7ec5c0
remove unused imports
cyberhorsey Nov 10, 2022
d45097d
Update packages/protocol/contracts/test/libs/TestLibTrieProof.sol
cyberhorsey Nov 10, 2022
40b38e5
mysql_password is optional
cyberhorsey Nov 10, 2022
7ecfd1b
separate DSN w/o mysql pw
cyberhorsey Nov 10, 2022
9eb3192
Update auto-generated docs
cyberhorsey Nov 10, 2022
834b6db
Update packages/relayer/indexer/filter_then_subscribe.go
cyberhorsey Nov 10, 2022
f1ae2dd
Update auto-generated docs
cyberhorsey Nov 10, 2022
4cd80a1
check if message owner is relayer addr
cyberhorsey Nov 10, 2022
74c8163
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
dacb9a9
Update packages/relayer/indexer/filter_then_subscribe.go
cyberhorsey Nov 10, 2022
5e89d9d
Update auto-generated docs
cyberhorsey Nov 10, 2022
7241551
golangcilint job + check err for CallContext
cyberhorsey Nov 10, 2022
6069877
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
6811ec1
wait for receipt + check status in process_message
cyberhorsey Nov 10, 2022
181e711
change hashing to go-ethereum lib
cyberhorsey Nov 10, 2022
0e70796
Update auto-generated docs
cyberhorsey Nov 10, 2022
122047a
abigen script, remove abis, add to gitignore
cyberhorsey Nov 10, 2022
a91405a
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
5e46901
skip-dirs
cyberhorsey Nov 10, 2022
1bc1c3d
Update auto-generated docs
cyberhorsey Nov 10, 2022
23b55df
lints
cyberhorsey Nov 10, 2022
764ebef
lints
cyberhorsey Nov 10, 2022
4f9f8c5
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
7947531
Update auto-generated docs
cyberhorsey Nov 10, 2022
590db94
Merge branch 'main' into relayer
cyberhorsey Nov 10, 2022
233b5fc
pass config file to gha
cyberhorsey Nov 10, 2022
aa4c712
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
ff2b34d
args
cyberhorsey Nov 10, 2022
a3e71d4
args
cyberhorsey Nov 10, 2022
a7a838e
latest
cyberhorsey Nov 10, 2022
33d1f77
Update auto-generated docs
cyberhorsey Nov 10, 2022
97e9c1a
use go 1.19
cyberhorsey Nov 10, 2022
d1ea418
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
993c7ed
Update auto-generated docs
cyberhorsey Nov 10, 2022
703dd6f
basic readme
cyberhorsey Nov 10, 2022
6ca9a55
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 10, 2022
e811cfd
Update auto-generated docs
cyberhorsey Nov 11, 2022
495bf5d
goose
cyberhorsey Nov 11, 2022
8c2c18b
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 11, 2022
a912c27
Update auto-generated docs
cyberhorsey Nov 11, 2022
d7b3e22
receipt fixes for unnecessary status check, remove dead code
cyberhorsey Nov 11, 2022
c2413fe
Merge branch 'relayer' of github.com:taikochain/taiko-mono into relayer
cyberhorsey Nov 11, 2022
e13ada7
Merge branch 'main' into relayer
cyberhorsey Nov 11, 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
Prev Previous commit
Next Next commit
message processing/proof generation
  • Loading branch information
cyberhorsey committed Oct 25, 2022
commit e21292da5b318e3b49781c57507123e3e17aa4e7
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,21 @@ require (
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/rjeczalik/notify v0.9.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
)
56 changes: 56 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=
github.com/ethereum/go-ethereum v1.10.25 h1:5dFrKJDnYf8L6/5o42abCE6a9yJm9cs4EJVRyYMr55s=
github.com/ethereum/go-ethereum v1.10.25/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
Expand All @@ -52,17 +55,32 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0kt
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4=
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ=
github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
Expand Down Expand Up @@ -112,6 +130,7 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f
github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
Expand Down Expand Up @@ -144,7 +163,16 @@ github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down Expand Up @@ -181,6 +209,7 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4=
github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI=
github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA=
Expand Down Expand Up @@ -216,25 +245,38 @@ golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -263,17 +305,31 @@ golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.2/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.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
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=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
26 changes: 23 additions & 3 deletions packages/relayer/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import (
"fmt"
"os"

"github.com/ethereum/go-ethereum/rpc"

"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/joho/godotenv"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -52,10 +55,26 @@ func main() {
}
defer l1EthClient.Close()

l2EthClient, err := ethclient.Dial(os.Getenv("L2_RPC_URL"))
if err != nil {
log.Fatal(err)
}
defer l2EthClient.Close()

rpcClient, err := rpc.DialContext(context.Background(), os.Getenv("L1_RPC_URL"))
if err != nil {
log.Fatal(err)
}

l1GethClient := gethclient.New(rpcClient)

i, err := indexer.NewService(indexer.NewServiceOpts{
EventRepo: eventRepository,
BlockRepo: blockRepository,
EthClient: l1EthClient,
EventRepo: eventRepository,
BlockRepo: blockRepository,
CrossLayerEthClient: l2EthClient,
EthClient: l1EthClient,
GethClient: l1GethClient,
ECDSAKey: os.Getenv("RELAYER_ECDSA_KEY"),
})
if err != nil {
log.Fatal(err)
Expand All @@ -68,6 +87,7 @@ func main() {
context.Background(),
relayer.EventNameMessageSent,
os.Getenv("L1_BRIDGE_ADDRESS"),
os.Getenv("L2_BRIDGE_ADDRESS"),
caughtUp,
); err != nil {
log.Fatal(err)
Expand Down
24 changes: 22 additions & 2 deletions packages/relayer/indexer/catch_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// CatchUp gets the most recent block height that has been indexed, and works it's way
// up to the latest block.
func (s *Service) CatchUp(ctx context.Context, eventName string, bridgeAddress string, caughtUp chan struct{}) error {
func (s *Service) CatchUp(ctx context.Context, eventName string, bridgeAddress string, crossLayerBridgeAddress string, caughtUp chan struct{}) error {
log.Info("indexing starting")
chainID, err := s.ethClient.ChainID(ctx)
if err != nil {
Expand Down Expand Up @@ -49,11 +49,15 @@ func (s *Service) CatchUp(ctx context.Context, eventName string, bridgeAddress s
// instantiate bridge contract and filter for messages
// starting from the most recently processed block,
// and ending at the latest.
bridge, err := contracts.NewBridgeFilterer(common.HexToAddress(bridgeAddress), s.ethClient)
bridge, err := contracts.NewBridge(common.HexToAddress(bridgeAddress), s.ethClient)
if err != nil {
return errors.Wrap(err, "contracts.NewBridge")
}

crossLayerBridge, err := contracts.NewBridge(common.HexToAddress(crossLayerBridgeAddress), s.crossLayerEthClient)
if err != nil {
return errors.Wrap(err, "contracts.NewBridge")
}
const batchSize = 1000
processingBlock := latestProcessedBlock
log.Infof("getting events between %v and %v in batches of %v", processingBlock.Height, header.Number.Int64(), batchSize)
Expand Down Expand Up @@ -123,6 +127,22 @@ func (s *Service) CatchUp(ctx context.Context, eventName string, bridgeAddress s
return errors.Wrap(err, "s.eventRepo.Save")
}

status, err := crossLayerBridge.GetMessageStatus(&bind.CallOpts{}, event.Signal)
if err != nil {
return errors.Wrap(err, "bridge.GetMessageStatus")
}

if status == uint8(relayer.EventStatusNew) {
log.Info("message not processed yet, attempting processing")
// process the message
if err := s.processMessage(ctx, event, crossLayerBridgeAddress); err != nil {
return errors.Wrap(err, "s.processMessage")
}

}

// TODO: update as processed

// if the block number is higher than the one we are processing,
// we can now consider that one processed. save it to the DB
// and bump the block number.
Expand Down
Loading