Skip to content

Commit

Permalink
Merge branch 'main' into ci-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
eedygreen authored Oct 7, 2024
2 parents 1dd5cf9 + 3834055 commit b91b11a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: actions/checkout@v2
- name: Run nodes
run: docker compose -f ./example/docker-compose.yml up -d
- name: Sleep
run: sleep 15
- name: Run tests
run: make e2e-test
- name: Print logs
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [2.4.1](https://github.com/sygmaprotocol/sygma-relayer/compare/v2.4.0...v2.4.1) (2024-09-18)


### Bug Fixes

* add generic call gas limit buffer ([#364](https://github.com/sygmaprotocol/sygma-relayer/issues/364)) ([3f01dae](https://github.com/sygmaprotocol/sygma-relayer/commit/3f01dae4cc69f46afd5c308c463ed6ae42a9f5f6))

## [2.4.0](https://github.com/sygmaprotocol/sygma-relayer/compare/v2.3.0...v2.4.0) (2024-09-16)


### Features

* treat native handler as erc20 ([#361](https://github.com/sygmaprotocol/sygma-relayer/issues/361)) ([d292ca0](https://github.com/sygmaprotocol/sygma-relayer/commit/d292ca0909459d2ad272bc76756996ed0333be63))


### Bug Fixes

* remove invalid frost resharing ([#363](https://github.com/sygmaprotocol/sygma-relayer/issues/363)) ([491f4f4](https://github.com/sygmaprotocol/sygma-relayer/commit/491f4f4367b5db716898c1157a1f2d66f0d5559a))
* remove peer as well as addresses from peerstore ([#359](https://github.com/sygmaprotocol/sygma-relayer/issues/359)) ([fca7423](https://github.com/sygmaprotocol/sygma-relayer/commit/fca74235f8a1b10e123e41d580715fa889fbc3fe))

## [2.3.0](https://github.com/sygmaprotocol/sygma-relayer/compare/v2.2.0...v2.3.0) (2024-09-03)


Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func Run() error {
mh.RegisterMessageHandler(transfer.TransferMessageType, &executor.TransferMessageHandler{})

switch handler.Type {
case "erc20":
case "erc20", "native":
{
depositHandler.RegisterDepositHandler(handler.Address, &depositHandlers.Erc20DepositHandler{})
}
Expand Down
8 changes: 5 additions & 3 deletions chains/evm/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import (
"github.com/sygmaprotocol/sygma-core/relayer/proposal"
)

const TRANSFER_GAS_COST = 200000
const (
TRANSFER_GAS_COST uint64 = 200000
)

type Batch struct {
proposals []*transfer.TransferProposal
Expand Down Expand Up @@ -212,9 +214,9 @@ func (e *Executor) proposalBatches(proposals []*proposal.Proposal) ([]*Batch, er
var propGasLimit uint64
l, ok := transferProposal.Data.Metadata["gasLimit"]
if ok {
propGasLimit = l.(uint64)
propGasLimit = l.(uint64) + TRANSFER_GAS_COST
} else {
propGasLimit = uint64(TRANSFER_GAS_COST)
propGasLimit = TRANSFER_GAS_COST
}
currentBatch.gasLimit += propGasLimit
if currentBatch.gasLimit >= e.transactionMaxGas {
Expand Down
8 changes: 0 additions & 8 deletions chains/evm/listener/eventHandlers/event-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,6 @@ func (eh *RefreshEventHandler) HandleEvents(
log.Err(err).Msgf("Failed executing ecdsa key refresh")
return nil
}
frostResharing := frostResharing.NewResharing(
eh.sessionID(startBlock), topology.Threshold, eh.host, eh.communication, eh.frostStorer,
)
err = eh.coordinator.Execute(context.Background(), []tss.TssProcess{frostResharing}, make(chan interface{}, 1))
if err != nil {
log.Err(err).Msgf("Failed executing frost key refresh")
return nil
}
return nil
}

Expand Down
1 change: 1 addition & 0 deletions comm/p2p/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func NewHost(privKey crypto.PrivKey, networkTopology *topology.NetworkTopology,
// LoadPeers clears out peerstore and loads new peers into it
func LoadPeers(h host.Host, peers []*peer.AddrInfo) {
for _, p := range h.Peerstore().Peers() {
h.Peerstore().RemovePeer(p)
h.Peerstore().ClearAddrs(p)
}

Expand Down
5 changes: 2 additions & 3 deletions comm/p2p/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ func (s *HostTestSuite) TestHost_NewHost_Success() {
)
s.Nil(err)
s.NotNil(host)
// 2 peers + host
s.Len(host.Peerstore().Peers(), 3)
s.Len(host.Peerstore().Peers(), 2)
}

func (s *HostTestSuite) TestHost_NewHost_InvalidPrivKey() {
Expand Down Expand Up @@ -117,5 +116,5 @@ func (s *LoadPeersTestSuite) Test_LoadPeers_RemovesOldAndSetsNewPeers() {

s.Equal(peerInSlice(newP1.ID, s.host.Peerstore().Peers()), true)
s.Equal(peerInSlice(newP2.ID, s.host.Peerstore().Peers()), true)
s.Equal(len(s.host.Peerstore().Peers()), 3)
s.Equal(len(s.host.Peerstore().Peers()), 2)
}
4 changes: 1 addition & 3 deletions example/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,9 @@ func Run() error {
depositHandler := depositHandlers.NewETHDepositHandler(bridgeContract)
mh := message.NewMessageHandler()
mh.RegisterMessageHandler(transfer.TransferMessageType, &executor.TransferMessageHandler{})
//mh.RegisterMessageHandler("FungibleTransfer", &executor.TransferMessageHandler{})
for _, handler := range config.Handlers {

switch handler.Type {
case "erc20":
case "erc20", "native":
{
depositHandler.RegisterDepositHandler(handler.Address, &depositHandlers.Erc20DepositHandler{})
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/binance-chain/tss-lib v0.0.0-00010101000000-000000000000
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/cenkalti/backoff/v4 v4.3.0
github.com/centrifuge/go-substrate-rpc-client/v4 v4.2.1
github.com/creasty/defaults v1.6.0
github.com/deckarep/golang-set/v2 v2.1.0
Expand Down Expand Up @@ -34,7 +35,6 @@ require (
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down

0 comments on commit b91b11a

Please sign in to comment.