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

Merge updates from master to master-v2 #1802

Merged
merged 93 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
6ba53bd
/block.validate endpoint (#1668)
Aug 10, 2020
cb3659f
feat: configurable DB pool size, queue target and queue interval (#1689)
unnawut Aug 10, 2020
cbbc2dc
feat: auto trigger chart version bump (#1695)
boolafish Aug 18, 2020
a7b4188
Block Validation: New Checks (#1693)
Aug 21, 2020
733aab2
feat: block queue metrics and stalled submission alarm (#1649)
unnawut Aug 26, 2020
b3081f8
feat: handle in-flight exits deletions (#1701)
pgebal Aug 28, 2020
f62dc06
move omg_performance json rpc tests to perf project (#1691)
ayrat555 Aug 28, 2020
1992805
chore: add feefeed docker to elixir-omg setup (#1700)
boolafish Sep 2, 2020
536059c
feat: reintroduce automated changelog (#1708)
unnawut Sep 2, 2020
fd1beac
fix: ignore block_submitting that are above mined blocks (#1703)
unnawut Sep 2, 2020
f302553
fix: fix in-flight exit deleted bug and add tests (#1714)
pgebal Sep 3, 2020
ed8b0f7
revert: reverts ife deletion commits (#1725)
pgebal Sep 4, 2020
a69e22c
Allow to run docker-compose without feefeed docker (#1726)
boolafish Sep 9, 2020
3d75118
add test for 64_000 txs block hash (#1729)
ayrat555 Sep 9, 2020
3206e4c
rm mix based chch (#1716)
Sep 15, 2020
27379ec
Inomurko/remove child chain (#1737)
Sep 16, 2020
6227b79
feat: handle in-flight exits deletions
pgebal Sep 16, 2020
a428fa1
move dev env deployment job to helm repo (#1738)
boolafish Sep 18, 2020
7d6415b
fix: handle metrics for in flight exit deleted processor (#1742)
pgebal Sep 18, 2020
ff66dd2
Kevsul/standard exit perf test (#1732)
kevsul Sep 18, 2020
37ca58f
Chore: try to fix flaky reorg tests (#1739)
ayrat555 Sep 21, 2020
b54eb17
update change log v1.0.4 (#1731)
jarindr Sep 29, 2020
722949a
Chore: parallelize tests by tags (#1744)
ayrat555 Sep 29, 2020
85c5fc0
Chore: use exexec from upstream (#1743)
ayrat555 Oct 1, 2020
b8631c5
fix: recheck PR label on synchronize and reopen (#1748)
unnawut Oct 14, 2020
1d8ea8e
feat: add deposits performance tests bot (#1745)
ayrat555 Oct 19, 2020
ad007ca
feat: transaction.create optimisation (#1683)
Oct 20, 2020
c6cb81f
chore: bump version to 1.0.4 (#1751)
boolafish Oct 21, 2020
34b9d54
feat: comply with new Infura API (#1754)
pgebal Oct 26, 2020
54305bb
chore: changelog/version bump for v1.0.5 (#1747)
achiurizo Oct 27, 2020
a49a33a
Publish the perf project (#1753)
ayrat555 Oct 27, 2020
ed74da2
Utxo perf test (#1756)
ayrat555 Oct 29, 2020
251cfc0
Add cli help command for the perf project (#1757)
ayrat555 Oct 29, 2020
33c3300
feat : transaction.merge endpoint (#1715)
nicholasmueller Nov 2, 2020
d60fc03
add perf cli smoke test (#1762)
ayrat555 Nov 10, 2020
a10ef42
feat: send web telemetry events to Datadog
Nov 11, 2020
6a30d47
fix: move env var fetch into Configuration module
Nov 12, 2020
3a6b6c4
fix: ensure current_route doesn't throw an exception
Nov 12, 2020
bbfff29
fix: allow nil release and current_version env vars
Nov 12, 2020
3e02d1c
Merge pull request #1766 from omgnetwork/add-datadog-error-metrics
Nov 13, 2020
a94baf8
Chore: fix feefeed container healthcheck (#1768)
ayrat555 Nov 13, 2020
2ec3903
feat: add new metadata to Datadog traces
Nov 16, 2020
46036bc
refactor: move configuration helpers to new module
Nov 18, 2020
d348983
refactor: remove unused app field in Application
Nov 18, 2020
3665ec1
fix: failing tracer and response tests
Nov 18, 2020
d8e4431
fix: aggressive test fix (#1772)
Nov 18, 2020
dcc2d3d
Collect metrics through datadog for the perf project (#1765)
ayrat555 Nov 19, 2020
7f57d39
Merge branch 'master' into add-metadata-to-dd-traces-2
Nov 20, 2020
4f5756b
retry datadog errors (#1774)
ayrat555 Nov 20, 2020
35a2f51
fix: run tests that alter globals consecutively
Nov 20, 2020
4df5f4d
Merge branch 'master' into add-metadata-to-dd-traces-2
Nov 20, 2020
1f73eb5
refactor: atom to string with interpolation
Nov 20, 2020
0a7a6e8
Merge pull request #1770 from omgnetwork/add-metadata-to-dd-traces-2
Nov 20, 2020
8acfb91
ignore known errors - Sentry spike protection (#1775)
Nov 20, 2020
97bbb49
Fix readme docker docs (#1773)
ayrat555 Nov 20, 2020
7043d16
config filter sentry (#1778)
Nov 20, 2020
71e51b1
add docker-compose for `test_docker_compose_release` (#1777)
ayrat555 Nov 23, 2020
cd6ecc4
extract geth command, remove childchain only code paths (#1781)
Nov 23, 2020
dfca58b
#1588 phx exception caused by invalid accept header is now ignored
DanielaIvanova Nov 23, 2020
fe59481
#1588 added a test
DanielaIvanova Nov 24, 2020
525b80f
ignore RequestTooLarge for Sentry (#1779)
achiurizo Nov 25, 2020
b90fdc9
set remote_ip from cf-connecting-ip header (#1679)
ayrat555 Nov 25, 2020
0c562c5
#1588 minor adjustmen
DanielaIvanova Nov 25, 2020
8a8ba61
Merge branch 'master' into v1.0.5
unnawut Nov 25, 2020
e4a4aa0
feat: add X-Watcher-Version header to http requests (#1767)
pgebal Nov 25, 2020
2ccb80d
#1588 minor fix
DanielaIvanova Nov 25, 2020
7da0801
Merge branch 'master' into danielaivanova/ignore-invalid-header
DanielaIvanova Nov 25, 2020
4c9bed9
Merge pull request #1783 from omgnetwork/danielaivanova/ignore-invali…
DanielaIvanova Nov 25, 2020
f2e71d4
fix: set service name as a tag in metrics
Nov 25, 2020
4f26803
Merge branch 'master' into dd-metrics-service-tag
Nov 25, 2020
9571ac0
Merge pull request #1786 from omgnetwork/dd-metrics-service-tag
Nov 25, 2020
822b033
fix: limit matching for ethereumex responses (#1782)
souradeep-das Nov 25, 2020
d0b86c8
just the one thing to turn into a warn (#1784)
achiurizo Nov 26, 2020
568ea4b
Renamed all occurrences of omisego to omgnetwork (#1788)
DanielaIvanova Nov 30, 2020
8629ad0
Merge branch 'master' into v1.0.5
boolafish Dec 1, 2020
f205fd3
chore: changelog/version bump for v1.0.5 (#1747) (#1785)
unnawut Dec 1, 2020
73749ca
Merge branch 'master' into v1.0.5
boolafish Dec 4, 2020
9abc6c7
Merge pull request #1790 from omgnetwork/v1.0.5
boolafish Dec 4, 2020
e88809a
chore: add sem release automation (#1791)
boolafish Dec 4, 2020
09efc26
bump elixir (#1789)
Dec 7, 2020
f0a8a05
align rust version to 1.46 (#1793)
Dec 7, 2020
fef32f8
trace reorg tests (#1796)
Dec 7, 2020
f116c63
fix: make sem release ignore PR check (#1797)
boolafish Dec 8, 2020
eff6352
chore: use git tag version instead (#1798)
boolafish Dec 11, 2020
15ab884
Merge remote-tracking branch 'origin/master' into ayrat555/merge-upda…
ayrat555 Dec 11, 2020
9d47dfa
update submodule
ayrat555 Dec 11, 2020
199b3e2
update mix file
ayrat555 Dec 11, 2020
f1489b5
fix mix files
ayrat555 Dec 11, 2020
2615e8d
update deps
ayrat555 Dec 14, 2020
e03c131
fix eip55
ayrat555 Dec 14, 2020
222599b
use new ex_plasma
ayrat555 Dec 14, 2020
86b71b1
fix ethereum event aggregator test
ayrat555 Dec 14, 2020
cf15e77
fix dialyzer
ayrat555 Dec 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
150 changes: 90 additions & 60 deletions .circleci/config.yml

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins:
- - '@semantic-release/commit-analyzer'
- preset: 'angular'
releaseRules:
- type: 'refactor'
release: 'patch'
- type: 'style'
release: 'patch'
- type: 'feat'
release: 'patch'
- type: 'chore'
release: 'patch'
- breaking: true
release: 'minor'
- '@semantic-release/release-notes-generator'
- '@semantic-release/github'
tagFormat: 'v${version}'
dryRun: true
# observing that job would not be running as it was considered as from PR branch
# looks that unfortunately that is how it is designed:
# https://github.com/semantic-release/semantic-release/issues/1166#issuecomment-500094323
# this workaround is from:
# https://github.com/semantic-release/semantic-release/issues/1074#issuecomment-696922883
ci: false
5 changes: 3 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
erlang 22.3
elixir 1.10.2
elixir 1.11.2
erlang 23.1.4
rust 1.46.0
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OmiseGo Pte Ltd
OMG Network Pte Ltd
28 changes: 20 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
# Changelog

## [Unreleased](https://github.com/omgnetwork/elixir-omg/tree/HEAD)
## [v1.0.5](https://github.com/omgnetwork/elixir-omg/tree/v1.0.5) (2020-10-01)

[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.4...HEAD)
[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.4-pre.2...v1.0.5)

### Enhancements

- deposits performance tests bot [\#1745](https://github.com/omgnetwork/elixir-omg/pull/1745) ([ayrat555](https://github.com/ayrat555))
- feat: handle in-flight exits deletions [\#1701](https://github.com/omgnetwork/elixir-omg/pull/1701) ([pgebal](https://github.com/pgebal))
- feat: comply with new Infura API [\#1754](https://github.com/omgnetwork/elixir-omg/pull/1754) ([pgebal](https://github.com/pgebal))

### Bug fixes

- fix: handle metrics for in flight exit deleted processor [\#1742](https://github.com/omgnetwork/elixir-omg/pull/1742) ([pgebal](https://github.com/pgebal))
- revert: reverts ife deletion commits [\#1725](https://github.com/omgnetwork/elixir-omg/pull/1725) ([pgebal](https://github.com/pgebal))
- fix: set :last\_ife\_exit\_deleted\_eth\_height on deplyment if it's not set yet [\#1720](https://github.com/omgnetwork/elixir-omg/pull/1720) ([pgebal](https://github.com/pgebal))
- fix: fix in-flight exit deleted bug and add tests [\#1714](https://github.com/omgnetwork/elixir-omg/pull/1714) ([pgebal](https://github.com/pgebal))
- fix: block submission stall monitor should ignore block\_submitting that are already mined [\#1703](https://github.com/omgnetwork/elixir-omg/pull/1703) ([unnawut](https://github.com/unnawut))
- fix: recheck PR label on synchronize and reopen [\#1748](https://github.com/omgnetwork/elixir-omg/pull/1748) ([unnawut](https://github.com/unnawut))

### Chores

- Chore: parallelize tests by tags [\#1744](https://github.com/omgnetwork/elixir-omg/pull/1744) ([ayrat555](https://github.com/ayrat555))
- Chore: use exexec from upstream [\#1743](https://github.com/omgnetwork/elixir-omg/pull/1743) ([ayrat555](https://github.com/ayrat555))
- move dev env deployment job to helm repo [\#1738](https://github.com/omgnetwork/elixir-omg/pull/1738) ([boolafish](https://github.com/boolafish))
- Inomurko/remove child chain [\#1737](https://github.com/omgnetwork/elixir-omg/pull/1737) ([InoMurko](https://github.com/InoMurko))
- Kevsul/standard exit perf test [\#1732](https://github.com/omgnetwork/elixir-omg/pull/1732) ([kevsul](https://github.com/kevsul))
- update change log v1.0.4 [\#1731](https://github.com/omgnetwork/elixir-omg/pull/1731) ([jarindr](https://github.com/jarindr))
- chore: add test for 64\_000 txs block hash [\#1729](https://github.com/omgnetwork/elixir-omg/pull/1729) ([ayrat555](https://github.com/ayrat555))
- Allow to run docker-compose without feefeed docker [\#1726](https://github.com/omgnetwork/elixir-omg/pull/1726) ([boolafish](https://github.com/boolafish))
- rm mix based chch part 1 [\#1716](https://github.com/omgnetwork/elixir-omg/pull/1716) ([InoMurko](https://github.com/InoMurko))
- feat: reintroduce automated changelog [\#1708](https://github.com/omgnetwork/elixir-omg/pull/1708) ([unnawut](https://github.com/unnawut))
- add feefeed docker to elixir-omg setup [\#1700](https://github.com/omgnetwork/elixir-omg/pull/1700) ([boolafish](https://github.com/boolafish))
- move omg\_performance json rpc tests to perf project [\#1691](https://github.com/omgnetwork/elixir-omg/pull/1691) ([ayrat555](https://github.com/ayrat555))
- chore: bump version to 1.0.4 [\#1751](https://github.com/omgnetwork/elixir-omg/pull/1751) ([boolafish](https://github.com/boolafish))
- Chore: try to fix flaky reorg tests [\#1739](https://github.com/omgnetwork/elixir-omg/pull/1739) ([ayrat555](https://github.com/ayrat555))
- feat: transaction.create optimisation [\#1683](https://github.com/omgnetwork/elixir-omg/pull/1683) ([okalouti](https://github.com/okalouti))

## [v1.0.4](https://github.com/omgnetwork/elixir-omg/tree/v1.0.4) (2020-09-03)

Expand All @@ -39,7 +55,6 @@

- corrrectly serialize PIDs in alarms.get [\#1678](https://github.com/omgnetwork/elixir-omg/pull/1678) ([ayrat555](https://github.com/ayrat555))
- account.get\_exitable\_utxos is unaware of in-flight exited inputs [\#1676](https://github.com/omgnetwork/elixir-omg/pull/1676) ([pnowosie](https://github.com/pnowosie))
- Fix fee adapter to accept decimal value in fee rules [\#1662](https://github.com/omgnetwork/elixir-omg/pull/1662) ([jarindr](https://github.com/jarindr))
- Add missing clause on witness validation check [\#1656](https://github.com/omgnetwork/elixir-omg/pull/1656) ([mederic-p](https://github.com/mederic-p))
- fix: unexpected http method [\#1651](https://github.com/omgnetwork/elixir-omg/pull/1651) ([ripzery](https://github.com/ripzery))

Expand Down Expand Up @@ -91,10 +106,6 @@
- Add reorged docker compose [\#1579](https://github.com/omgnetwork/elixir-omg/pull/1579) ([ayrat555](https://github.com/ayrat555))
- Kevin/load test erc20 token [\#1577](https://github.com/omgnetwork/elixir-omg/pull/1577) ([kevsul](https://github.com/kevsul))

### Documentation updates

- Update request body swagger [\#1609](https://github.com/omgnetwork/elixir-omg/pull/1609) ([jarindr](https://github.com/jarindr))

## [v1.0.2](https://github.com/omgnetwork/elixir-omg/tree/v1.0.2) (2020-06-30)

[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.2-pre.0...v1.0.2)
Expand Down Expand Up @@ -122,11 +133,12 @@

### Documentation updates

- Update request body swagger [\#1609](https://github.com/omgnetwork/elixir-omg/pull/1609) ([jarindr](https://github.com/jarindr))
- Update README.md [\#1564](https://github.com/omgnetwork/elixir-omg/pull/1564) ([InoMurko](https://github.com/InoMurko))

## [v1.0.1](https://github.com/omgnetwork/elixir-omg/tree/v1.0.1) (2020-06-18)

[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.1-pre.0...v1.0.1)
[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.0-pre.2...v1.0.1)

### Chores

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.watcher
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.11

LABEL maintainer="OmiseGO Team <[email protected]>"
LABEL description="Official image for OmiseGO (Watcher) Plasma Network"
LABEL maintainer="OMG Network Team <[email protected]>"
LABEL description="Official image for OMG Network (Watcher) Plasma Network"

ENV LANG=C.UTF-8

Expand Down Expand Up @@ -54,7 +54,7 @@ RUN set -xe \
#rocksdb from builder image to deployer image
RUN mkdir -p /usr/local/rocksdb/lib
RUN mkdir /usr/local/rocksdb/include
COPY --from=omisegoimages/elixir-omg-builder:stable-20200410 /usr/local/rocksdb/ /usr/local/rocksdb/
COPY --from=omisegoimages/elixir-omg-builder:stable-20201207 /usr/local/rocksdb/ /usr/local/rocksdb/

ARG release_version
ADD _build_docker/prod/watcher-${release_version}.tar.gz /app
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.watcher_info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.11

LABEL maintainer="OmiseGO Team <[email protected]>"
LABEL description="Official image for OmiseGO (WatcherInfo) Plasma Network"
LABEL maintainer="OMG Network Team <[email protected]>"
LABEL description="Official image for OMG Network (WatcherInfo) Plasma Network"

ENV LANG=C.UTF-8

Expand Down Expand Up @@ -54,7 +54,7 @@ RUN set -xe \
#rocksdb from builder image to deployer image
RUN mkdir -p /usr/local/rocksdb/lib
RUN mkdir /usr/local/rocksdb/include
COPY --from=omisegoimages/elixir-omg-builder:stable-20200410 /usr/local/rocksdb/ /usr/local/rocksdb/
COPY --from=omisegoimages/elixir-omg-builder:stable-20201207 /usr/local/rocksdb/ /usr/local/rocksdb/

ARG release_version
ADD _build_docker/prod/watcher_info-${release_version}.tar.gz /app
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

Copyright 2017-2019 OmiseGO
Copyright 2017-2019 OMG Network

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ all: clean build-watcher-prod build-watcher_info-prod
WATCHER_IMAGE_NAME ?= "omisego/watcher:latest"
WATCHER_INFO_IMAGE_NAME ?= "omisego/watcher_info:latest"

IMAGE_BUILDER ?= "omisegoimages/elixir-omg-builder:stable-20200410"
IMAGE_BUILDER ?= "omisegoimages/elixir-omg-builder:stable-20201207"
IMAGE_BUILD_DIR ?= $(PWD)

ENV_DEV ?= env MIX_ENV=dev
Expand Down Expand Up @@ -293,14 +293,14 @@ docker-watcher_info-prod:

docker-watcher-build:
docker build -f Dockerfile.watcher \
--build-arg release_version=$$(cat $(PWD)/VERSION)+$$(git rev-parse --short=7 HEAD) \
--build-arg release_version=$$(git describe --tags) \
--cache-from $(WATCHER_IMAGE_NAME) \
-t $(WATCHER_IMAGE_NAME) \
.

docker-watcher_info-build:
docker build -f Dockerfile.watcher_info \
--build-arg release_version=$$(cat $(PWD)/VERSION)+$$(git rev-parse --short=7 HEAD) \
--build-arg release_version=$$(git describe --tags) \
--cache-from $(WATCHER_INFO_IMAGE_NAME) \
-t $(WATCHER_INFO_IMAGE_NAME) \
.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img src="docs/assets/logo.png" width="100" height="100" align="right" />

The `elixir-omg` repository contains OmiseGO's Elixir implementation of Plasma and forms the basis for the OMG Network.
The `elixir-omg` repository contains OMG Network's Elixir implementation of Plasma and forms the basis for the OMG Network.

[![Build Status](https://circleci.com/gh/omgnetwork/elixir-omg.svg?style=svg)](https://circleci.com/gh/omgnetwork/elixir-omg) [![Coverage Status](https://coveralls.io/repos/github/omisego/elixir-omg/badge.svg?branch=master)](https://coveralls.io/github/omisego/elixir-omg?branch=master)

Expand Down Expand Up @@ -116,10 +116,10 @@ mix test

Longer-running integration tests (requires compiling contracts):
```bash
mix test --trace --only integration
mix test --only integration
```

For other kinds of checks, refer to the CI/CD pipeline (https://circleci.com/gh/omisego/workflows/elixir-omg) or build steps (https://github.com/omisego/elixir-omg/blob/master/.circleci/config.yml).
For other kinds of checks, refer to the CI/CD pipeline (https://app.circleci.com/pipelines/github/omgnetwork/elixir-omg) or build steps (https://github.com/omgnetwork/elixir-omg/blob/master/.circleci/config.yml).

To run a development `iex` REPL with all code loaded:
```bash
Expand Down Expand Up @@ -207,15 +207,15 @@ cd priv/cabbage
make install
make generate_api_code
mix deps.get
REORG=true mix test --only reorg --trace
REORG=true mix test --only reorg
```

# Working with API Spec's

This repo contains `gh-pages` branch intended to host [Swagger-based](https://docs.omg.network/elixir-omg/) API specification.
Branch `gh-pages` is totally diseparated from other development branches and contains just Slate generated page's files.

See [gh-pages README](https://github.com/omisego/elixir-omg/tree/gh-pages) for more details.
See [gh-pages README](https://github.com/omgnetwork/elixir-omg/tree/gh-pages) for more details.

# More details about the design and architecture

Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion apps/omg/lib/omg.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 OmiseGO Pte Ltd
# Copyright 2019-2020 OMG Network Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion apps/omg/lib/omg/application.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 OmiseGO Pte Ltd
# Copyright 2019-2020 OMG Network Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion apps/omg/lib/omg/block.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 OmiseGO Pte Ltd
# Copyright 2019-2020 OMG Network Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion apps/omg/lib/omg/configuration.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 OmiseGO Pte Ltd
# Copyright 2019-2020 OMG Network Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
13 changes: 7 additions & 6 deletions apps/omg/lib/omg/crypto.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 OmiseGO Pte Ltd
# Copyright 2019-2020 OMG Network Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,6 +20,7 @@ defmodule OMG.Crypto do
For unsafe code, limited to `:test` and `:dev` environments and related to private key handling refer to:
`OMG.DevCrypto` in `test/support`
"""
alias ExPlasma.Crypto
alias OMG.Signature

@type sig_t() :: <<_::520>>
Expand All @@ -41,22 +42,22 @@ defmodule OMG.Crypto do
171, 76, 106, 229, 69, 102, 203, 7, 21, 134, 230, 92, 23, 209, 187, 12>>
"""
@spec hash(binary) :: hash_t()
def hash(message), do: ExthCrypto.Hash.hash(message, ExthCrypto.Hash.kec())
def hash(message), do: Crypto.keccak_hash(message)

@doc """
Recovers the address of the signer from a binary-encoded signature.
"""
@spec recover_address(hash_t(), sig_t()) :: {:ok, address_t()} | {:error, :signature_corrupt | binary}
@spec recover_address(hash_t(), sig_t()) :: {:ok, address_t()} | {:error, atom()}
def recover_address(<<digest::binary-size(32)>>, <<packed_signature::binary-size(65)>>) do
case Signature.recover_public(digest, packed_signature) do
{:ok, pub} ->
generate_address(pub)

{:error, "Recovery id invalid 0-3"} ->
{:error, :recovery_id_not_u8} ->
{:error, :signature_corrupt}

other ->
other
{:error, _} = error ->
error
end
end

Expand Down
33 changes: 17 additions & 16 deletions apps/omg/lib/omg/ethereum_event_listener.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 OmiseGO Pte Ltd
# Copyright 2019-2020 OMG Network Pte Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -146,7 +146,7 @@ defmodule OMG.EthereumEventListener do

case RootChainCoordinator.get_sync_info() do
:nosync ->
:ok = RootChainCoordinator.check_in(Core.get_height_to_check_in(state), state.service_name)
:ok = RootChainCoordinator.check_in(state.synced_height, state.service_name)
{:ok, _} = schedule_get_events(state.ethereum_events_check_interval_ms)
{:noreply, {state, callbacks}}

Expand All @@ -158,31 +158,32 @@ defmodule OMG.EthereumEventListener do
end

# see `handle_info/2`, clause for `:sync`
@decorate span(service: :ethereum_event_listener, type: :backend, name: "sync_height/2")
@decorate span(service: :ethereum_event_listener, type: :backend, name: "sync_height/3")
defp sync_height(state, callbacks, sync_guide) do
{:ok, events, db_updates, height_to_check_in, new_state} =
Core.get_events_range_for_download(state, sync_guide)
|> maybe_update_event_cache(callbacks.get_ethereum_events_callback)
|> Core.get_events(sync_guide.sync_height)
{events, new_state} =
state
|> Core.calc_events_range_set_height(sync_guide)
|> get_events(callbacks.get_ethereum_events_callback)

:ok = :telemetry.execute([:process, __MODULE__], %{events: events}, state)
db_update = [{:put, new_state.synced_height_update_key, new_state.synced_height}]
:ok = :telemetry.execute([:process, __MODULE__], %{events: events}, new_state)

{:ok, db_updates_from_callback} = callbacks.process_events_callback.(events)
:ok = publish_events(events)
:ok = OMG.DB.multi_update(db_updates ++ db_updates_from_callback)
:ok = RootChainCoordinator.check_in(height_to_check_in, state.service_name)
:ok = OMG.DB.multi_update(db_update ++ db_updates_from_callback)
:ok = RootChainCoordinator.check_in(new_state.synced_height, new_state.service_name)

new_state
end

@decorate span(service: :ethereum_event_listener, type: :backend, name: "maybe_update_event_cache/2")
defp maybe_update_event_cache({:get_events, {from, to}, %Core{} = state}, get_ethereum_events_callback) do
{:ok, new_events} = get_ethereum_events_callback.(from, to)
Core.add_new_events(state, new_events)
defp get_events({{from, to}, state}, get_events_callback) do
{:ok, new_events} = get_events_callback.(from, to)
{new_events, state}
end

@decorate span(service: :ethereum_event_listener, type: :backend, name: "maybe_update_event_cache/2")
defp maybe_update_event_cache({:dont_fetch_events, %Core{} = state}, _callback), do: state
defp get_events({:dont_fetch_events, state}, _callback) do
{[], state}
end

defp schedule_get_events(ethereum_events_check_interval_ms) do
:timer.send_after(ethereum_events_check_interval_ms, self(), :sync)
Expand Down
Loading