diff --git a/.mergify.yml b/.mergify.yml index a019ae47..2e7f5565 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -61,4 +61,4 @@ pull_request_rules: actions: backport: branches: - - release/v1.x.x + - release/v1.x.x \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 50ab94ce..daf9a8cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,24 +45,39 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements -[#367] Set ETH block delay to 96 blocks -[#362](https://github.com/umee-network/peggo/pull/362) Update umeed to v3. -[#343](https://github.com/umee-network/peggo/pull/343) Upgrade to cosmos-sdk v0.46.1. -[#341](https://github.com/umee-network/peggo/pull/341) Fix linter. -[#334](https://github.com/umee-network/peggo/pull/334) Update to go 1.18. -[#326](https://github.com/umee-network/peggo/pull/326) Refactory of eth `getCurrentBlock`. -[#311](https://github.com/umee-network/peggo/pull/311) Add valset update at each 2000 eth blocks. +- [#376] Add `eth-merge-pause` flag -### Bug Fixes +## [v1.1.0](https://github.com/umee-network/peggo/releases/tag/v1.1.0) - 2022-09-26 + +### Improvements + +- [#367] Set ETH block delay to 96 blocks + +## [v1.0.1](https://github.com/umee-network/peggo/releases/tag/v1.0.1) - 2022-09-21 + +### Improvements + +- [#365] Reduce oracle noise msgs + +## [v1.0.0](https://github.com/umee-network/peggo/releases/tag/v1.0.0) - 2022-09-14 + +### Improvements + +- [#362](https://github.com/umee-network/peggo/pull/362) Update umeed to v3. +- [#343](https://github.com/umee-network/peggo/pull/343) Upgrade to cosmos-sdk v0.46.1. +- [#341](https://github.com/umee-network/peggo/pull/341) Fix linter. +- [#334](https://github.com/umee-network/peggo/pull/334) Update to go 1.18. +- [#326](https://github.com/umee-network/peggo/pull/326) Refactory of eth `getCurrentBlock`. +- [#311](https://github.com/umee-network/peggo/pull/311) Add valset update at each 2000 eth blocks. ## [v0.4.0](https://github.com/umee-network/peggo/releases/tag/v0.4.0) - 2022-07-14 ### Improvements -[#308](https://github.com/umee-network/peggo/pull/308) Change stablecoin from UST to DAI. -[#299](https://github.com/umee-network/peggo/pull/299) Fix lint warnings. -[#297](https://github.com/umee-network/peggo/pull/297) Update dependabot reviewers. -[#275](https://github.com/umee-network/peggo/pull/275) Add diagrams of main loops. +- [#308](https://github.com/umee-network/peggo/pull/308) Change stablecoin from UST to DAI. +- [#299](https://github.com/umee-network/peggo/pull/299) Fix lint warnings. +- [#297](https://github.com/umee-network/peggo/pull/297) Update dependabot reviewers. +- [#275](https://github.com/umee-network/peggo/pull/275) Add diagrams of main loops. ### Bug Fixes diff --git a/cmd/peggo/flags.go b/cmd/peggo/flags.go index 66db0251..4a6b9966 100644 --- a/cmd/peggo/flags.go +++ b/cmd/peggo/flags.go @@ -55,6 +55,7 @@ const ( flagRelayerLoopMultiplier = "relayer-loop-multiplier" flagRequesterLoopMultiplier = "requester-loop-multiplier" flagBridgeStartHeight = "bridge-start-height" + flagEthMergePause = "eth-merge-pause" // TODO: remove this after merge is completed ) func cosmosFlagSet() *pflag.FlagSet { diff --git a/cmd/peggo/orchestrator.go b/cmd/peggo/orchestrator.go index 47741992..ee3bc11b 100644 --- a/cmd/peggo/orchestrator.go +++ b/cmd/peggo/orchestrator.go @@ -252,6 +252,7 @@ func getOrchestratorCmd() *cobra.Command { konfig.Int64(flagBridgeStartHeight), symbolRetriever, o, + konfig.Bool(flagEthMergePause), ) g, errCtx := errgroup.WithContext(ctx) @@ -276,6 +277,7 @@ func getOrchestratorCmd() *cobra.Command { cmd.Flags().Bool(flagRelayBatches, false, "Relay transaction batches to Ethereum") cmd.Flags().Int64(flagEthBlocksPerLoop, 2000, "Number of Ethereum blocks to process per orchestrator loop") cmd.Flags().String(flagCoinGeckoAPI, "https://api.coingecko.com/api/v3", "Specify the coingecko API endpoint") + cmd.Flags().Bool(flagEthMergePause, false, "Pause some messages related to the adaptation of the Gravity Bridge to the merge") //nolint: lll defaultProviders := []string{ umeepfprovider.ProviderOsmosis.String(), diff --git a/orchestrator/eth_event_watcher.go b/orchestrator/eth_event_watcher.go index 46799afc..fe8752b2 100644 --- a/orchestrator/eth_event_watcher.go +++ b/orchestrator/eth_event_watcher.go @@ -202,6 +202,13 @@ func (p *gravityOrchestrator) CheckForEvents( valsetUpdates := filterValsetUpdateEventsByNonce(valsetUpdatedEvents, lastEventResp.EventNonce) deployedERC20Updates := filterERC20DeployedEventsByNonce(erc20DeployedEvents, lastEventResp.EventNonce) + // Don't send anything other than valsetUpdates + if p.ethMergePause { + deposits = []*wrappers.GravitySendToCosmosEvent{} + withdraws = []*wrappers.GravityTransactionBatchExecutedEvent{} + deployedERC20Updates = []*wrappers.GravityERC20DeployedEvent{} + } + if len(deposits) > 0 || len(withdraws) > 0 || len(valsetUpdates) > 0 || len(deployedERC20Updates) > 0 { if err := p.gravityBroadcastClient.SendEthereumClaims( diff --git a/orchestrator/eth_event_watcher_test.go b/orchestrator/eth_event_watcher_test.go index a42dc796..97e56d47 100644 --- a/orchestrator/eth_event_watcher_test.go +++ b/orchestrator/eth_event_watcher_test.go @@ -166,6 +166,7 @@ func TestCheckForEvents(t *testing.T) { 0, nil, nil, + false, ) currentBlock, err := orch.CheckForEvents(context.Background(), 1, 5) @@ -248,6 +249,7 @@ func TestCheckForEvents(t *testing.T) { 0, nil, nil, + false, ) currentBlock, err := orch.CheckForEvents(context.Background(), 1, 5) @@ -357,6 +359,7 @@ func TestCheckForEvents(t *testing.T) { 0, nil, nil, + false, ) currentBlock, err := orch.CheckForEvents(context.Background(), 1, 5) @@ -480,6 +483,7 @@ func TestCheckForEvents(t *testing.T) { 0, nil, nil, + false, ) currentBlock, err := orch.CheckForEvents(context.Background(), 1, 5) @@ -617,6 +621,7 @@ func TestCheckForEvents(t *testing.T) { 0, nil, nil, + false, ) currentBlock, err := orch.CheckForEvents(context.Background(), 1, 5) diff --git a/orchestrator/main_loops.go b/orchestrator/main_loops.go index 8c24e2a6..0c62bf1c 100644 --- a/orchestrator/main_loops.go +++ b/orchestrator/main_loops.go @@ -64,12 +64,14 @@ func (p *gravityOrchestrator) Start(ctx context.Context) error { return p.EthOracleMainLoop(ctx) }) - pg.Go(func() error { - // looks at the BatchFees on Cosmos and uses the query endpoint BatchFees - // to iterate over each token to see if it is profitable, if it is - // it will send an request batch for that denom - return p.BatchRequesterLoop(ctx) - }) + if !p.ethMergePause { + pg.Go(func() error { + // looks at the BatchFees on Cosmos and uses the query endpoint BatchFees + // to iterate over each token to see if it is profitable, if it is + // it will send an request batch for that denom + return p.BatchRequesterLoop(ctx) + }) + } pg.Go(func() error { // Gets the last pending valset to send an MsgValsetConfirm that sends @@ -81,6 +83,8 @@ func (p *gravityOrchestrator) Start(ctx context.Context) error { return p.EthSignerMainLoop(ctx) }) + // Let this function run as is. If we see errors caused by this loop, then + // we might need to enable batch confirms. pg.Go(func() error { // Gets the latest valset available and updating it on the ethereum // smartcontract if needed. Also gets all the pending transaction @@ -268,6 +272,8 @@ func (p *gravityOrchestrator) EthSignerMainLoop(ctx context.Context) (err error) } } + // Try to send batch confirms. If this fails, it means there are pending batches + // that we'll need to sign before the next upgrade. var oldestUnsignedTransactionBatch []types.OutgoingTxBatch if err := retry.Do(func() error { // sign the last unsigned batch, TODO check if we already have signed this diff --git a/orchestrator/oracle_resync_test.go b/orchestrator/oracle_resync_test.go index 9da776ab..40d0cb0a 100644 --- a/orchestrator/oracle_resync_test.go +++ b/orchestrator/oracle_resync_test.go @@ -160,6 +160,7 @@ func TestGetLastCheckedBlock(t *testing.T) { 0, nil, nil, + false, ) block, err := orch.GetLastCheckedBlock(context.Background(), 0) diff --git a/orchestrator/orchestrator.go b/orchestrator/orchestrator.go index 80b906a3..bacf7445 100644 --- a/orchestrator/orchestrator.go +++ b/orchestrator/orchestrator.go @@ -46,6 +46,7 @@ type gravityOrchestrator struct { mtx sync.Mutex erc20DenomCache map[string]string + ethMergePause bool } func NewGravityOrchestrator( @@ -64,6 +65,7 @@ func NewGravityOrchestrator( bridgeStartHeight int64, symbolRetriever relayer.SymbolRetriever, oracle relayer.Oracle, + ethMergePause bool, // TODO: remove this after merge is completed options ...func(GravityOrchestrator), ) GravityOrchestrator { @@ -84,6 +86,7 @@ func NewGravityOrchestrator( bridgeStartHeight: uint64(bridgeStartHeight), symbolRetriever: symbolRetriever, oracle: oracle, + ethMergePause: ethMergePause, } for _, option := range options {