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/update agents #614

Closed
wants to merge 18 commits into from
Closed
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ jobs:
# see: https://www.reddit.com/r/golang/comments/476pae/how_to_speed_up_go_compiler_and_many_other_go/
env:
GOGC: 2000
GOMEMLIMIT: 6GiB

#note: right now this is not run against all work dirs
lint:
Expand Down
1 change: 1 addition & 0 deletions Makefile
1 change: 0 additions & 1 deletion agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

The Agents are the off-chain components of Sanguine. They are responsible for signing, reporting, verifying, and executing messages across chains.


## Use

From `sanguine/agents`, run `go run main.go` to expose the CLI for all agents. Visit each agents' respective directory's README.md for information on individual agent usage.
Expand Down
195 changes: 11 additions & 184 deletions agents/contracts/attestationcollector/attestationcollector.abigen.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

211 changes: 19 additions & 192 deletions agents/contracts/destination/destination.abigen.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

213 changes: 20 additions & 193 deletions agents/contracts/origin/origin.abigen.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion agents/contracts/origin/origin.contractinfo.json

Large diffs are not rendered by default.

215 changes: 21 additions & 194 deletions agents/contracts/test/destinationharness/destinationharness.abigen.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

217 changes: 22 additions & 195 deletions agents/contracts/test/originharness/originharness.abigen.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

215 changes: 21 additions & 194 deletions agents/contracts/test/testclient/testclient.abigen.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions agents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/coinbase/rosetta-sdk-go v0.8.1
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.26
github.com/hedzr/log v1.6.3
github.com/ipfs/go-log v1.0.5
github.com/jftuga/ellipsis v1.0.0
github.com/jftuga/termsize v1.0.2
Expand Down
3 changes: 3 additions & 0 deletions agents/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOn
github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
github.com/hdevalence/ed25519consensus v0.0.0-20201207055737-7fde80a9d5ff/go.mod h1:Feit0l8NcNO4g69XNjwvsR0LGcwMMfzI1TF253rOIlQ=
github.com/hedzr/log v1.6.3 h1:qCdnDUpeQ+E9vmfDKk+IHjA0QipnWNds2mr4hh6iGxA=
github.com/hedzr/log v1.6.3/go.mod h1:goMXeVWLSKZYxNs+10viGe2O1fbzBNnnLpdx0MoCRkA=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
Expand Down Expand Up @@ -1901,6 +1903,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
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/hedzr/errors.v3 v3.1.1/go.mod h1:UwtyepqtGTIAmdZGSc7wxXT5Gfd/BjcfRMhPpxwkJM4=
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI=
Expand Down
33 changes: 22 additions & 11 deletions contrib/git-changes-action/detector/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"strings"

"github.com/avast/retry-go"
"github.com/google/go-github/v41/github"
"github.com/synapsecns/sanguine/contrib/git-changes-action/detector/actionscore"
"github.com/synapsecns/sanguine/contrib/git-changes-action/detector/tree"
"golang.org/x/exp/slices"
"golang.org/x/oauth2"
"os"
"strings"
"time"
)

// GetChangeTree returns the ref for the given event name.
Expand Down Expand Up @@ -64,15 +65,25 @@ func getChangedFilesFromAPI(ctx context.Context, ghContext *actionscore.Context,
ct = tree.NewTree()

page := 1
perPage := 20
const retryCount = 10
for {
files, res, err := client.PullRequests.ListFiles(ctx, repoOwner, repoName, prNumber, &github.ListOptions{
Page: page,
PerPage: perPage,
})
var files []*github.CommitFile
var res *github.Response
err = retry.Do(func() error {
reqCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
defer cancel()

files, res, err = client.PullRequests.ListFiles(reqCtx, repoOwner, repoName, prNumber, &github.ListOptions{
Page: page,
PerPage: 100,
})
if err != nil {
return fmt.Errorf("could not get files: %w", err)
}
return nil
}, retry.Context(ctx), retry.Attempts(retryCount))
if err != nil {
return nil, fmt.Errorf("could not get files for repoOwner %s, repoName %s, prNumber %d, page number %d with page size %d: %w",
repoOwner, repoName, prNumber, page, perPage, err)
return nil, fmt.Errorf("could not get files after %d retries: %w", retryCount, err)
}

for _, file := range files {
Expand All @@ -84,7 +95,7 @@ func getChangedFilesFromAPI(ctx context.Context, ghContext *actionscore.Context,
}
}

if page == res.LastPage {
if res.NextPage == 0 {
break
}

Expand Down
1 change: 1 addition & 0 deletions contrib/git-changes-action/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ replace (

require (
github.com/Flaque/filet v0.0.0-20201012163910-45f684403088
github.com/avast/retry-go v3.0.0+incompatible
github.com/brianvoe/gofakeit/v6 v6.20.1
github.com/ethereum/go-ethereum v1.10.26
github.com/go-git/go-git/v5 v5.5.2
Expand Down
2 changes: 2 additions & 0 deletions contrib/git-changes-action/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0=
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/brianvoe/gofakeit/v6 v6.20.1 h1:8ihJ60OvPnPJ2W6wZR7M+TTeaZ9bml0z6oy4gvyJ/ek=
github.com/brianvoe/gofakeit/v6 v6.20.1/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8=
Expand Down
Loading