AthanorLabs / atomic-swap

💫 ETH-XMR atomic swap implementation
GNU Lesser General Public License v3.0
345 stars 44 forks source link

made optimism endpoint configurable and changed default #502

Closed dimalinux closed 1 year ago

dimalinux commented 1 year ago

The initial Optimism endpoint that I picked, https://1rpc.io/op, has degraded. It now, on a semi-regular basis, just returns an EOF error. (Worse than other endpoints, that give a message about being over the rate limit or a connection-refused error.)

This PR picks a different endpoint, from blockpi, and also makes the optimism endpoint configurable via an ETH_OPTIMISM_ENDPOINT environment variable. The naming of the variable was picked to match the unit test variables for Sepolia and Mainnet, and this new variable can also be set in the github secrets for CI.

Note that this variable name does not match the CLI environment variables that can be used in place of a CLI flag. If we don't end up finding a reliable endpoint, we may want to add full CLI support for setting the endpoint and using a variable name like SWAPD_OPTIMISM_ENDPOINT.

This PR also adds a fix that is needed due to prettier changes in the new 3.0.0 release.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.06 :warning:

Comparison is base (3b4870e) 60.98% compared to head (8211eff) 60.92%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #502 +/- ## ========================================== - Coverage 60.98% 60.92% -0.06% ========================================== Files 129 129 Lines 12837 12843 +6 ========================================== - Hits 7829 7825 -4 - Misses 4187 4195 +8 - Partials 821 823 +2 ``` | [Impacted Files](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/502?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [pricefeed/pricefeed.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/502?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJpY2VmZWVkL3ByaWNlZmVlZC5nbw==) | `65.85% <100.00%> (+2.69%)` | :arrow_up: | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/502/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.