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

Making Child-chain work with fee feed #1500

Merged
merged 6 commits into from
May 13, 2020
Merged

Making Child-chain work with fee feed #1500

merged 6 commits into from
May 13, 2020

Conversation

pnowosie
Copy link
Contributor

@pnowosie pnowosie commented May 5, 2020

I was preparing demo to show Child-chain & Fee Service integration. I discovered that ch-ch can parse slightly different fee rules format that FeeService publishes.

I made just the needed changes to make ch-ch understand rules from feed.
I made tests green.

Also fee rules from FeeService does not fully complies to what was agreed before, ✍️ so I've created an issue Fee feed response has been adapted in this PR

📋 Add associated issues, tickets, docs URL here.

Overview

I just made the needed changes to make ch-ch understand feed format, and made the tests green.

Changes

JSONFeeParser & JSONSingleSpecParser adapted to FeeService returned json structure.

Testing

Fixing the current tests

@coveralls
Copy link

coveralls commented May 5, 2020

Coverage Status

Coverage increased (+0.02%) to 78.167% when pulling 343151a on papa/feefeed-demo into 40616b4 on master.

@pnowosie pnowosie force-pushed the papa/feefeed-demo branch 4 times, most recently from fb93bd9 to 497d5cd Compare May 5, 2020 15:02
@pnowosie pnowosie marked this pull request as ready for review May 5, 2020 15:30
@pnowosie pnowosie changed the title Making Child-chain work with fee feed (UNFINISHED) Making Child-chain work with fee feed May 11, 2020
@mederic-p
Copy link
Contributor

Looks good, but don't forget to coordinate with devops team to update the fee file in helm chart.

@pnowosie
Copy link
Contributor Author

@mederic-p: Looks good, but don't forget to coordinate with devops team to update the fee file in helm chart.

PR is done "there" ;) Thanks for the remainder!

@pnowosie pnowosie merged commit 6e178d2 into master May 13, 2020
@pnowosie pnowosie deleted the papa/feefeed-demo branch May 13, 2020 07:45
kalouo pushed a commit that referenced this pull request May 18, 2020
* config changes

* hack: making ch-ch work with feefeed

* test: fix tests

* chore: restore barebone variables (no feed is running), small linter fixes

* test: try to fix ch-ch integration tests

* chore: restore deleted `updated_at` field
kalouo pushed a commit that referenced this pull request May 28, 2020
* add: db-level code for deposit.all endpoint

* test: db-level code for deposit.all endpoint

* add: api-level code for deposit.all endpoint

* test: api-level code for deposit.all endpoint

* add: deposit.all endpoint, controller, validator and views

* test: deposit.all controller

* refactor: length assertion

* refactor: get_events spec

* migration: initial supporting code

* migration: add eth_height to ethevents

* refactor and add: supporting code for migration

* add: start Ethereumex for migrations

* fix: lint

* refactor: re-scope modules from "ethevent" to "deposit" above DB.

* feat: persist eth_height in deposit event

* feat: persist eth_height in standard exit event

* tests: reflect addition of eth_height to persisted deposits

* refactor: Enum -> Stream

* fix: dialyzer spec error

* add: db-level code for deposit.all endpoint

* test: db-level code for deposit.all endpoint

* add: api-level code for deposit.all endpoint

* Add timestamp and scheduled finalisation time to InvalidExit and UnchallengedExit events (#1495)

* feat: add root_chain_txhash to persistence layer

* [ADD]: rc txhash to se_event test helper

* add: root_chain_txhash to remaining methods

* fix: persistence test

* refactor: simply rc  txhash creation

* add: root_chain_txhash to InvalidExit event

* add: root_chain_txhash to UnchallengedExit event

* refactor and add dialyzer specs

* refactor: add method for txhash creation

* remove: pattern match for make_db_update

* requested changes

* add: random bytes helper

* fix: default recently added keys to nil for previously existing values

* refactor and move_tests

* requested changes [1]

* fix: InvalidExit and UnchallengedExit accept nil `root_chain_txhash`

* feat: logic for adding sft

* add: scheduled_finalization_time to exit events

* tests: calculate_sft/4 and add sft to recent keys

* fix: dialyzer and remove logging

* fix: test setup

* refactor: sft contract calls at GenServer level

* add: sft to test exit structs

* alias nested modules

* update: Swagger API specs

* add: min_exit_period_seconds to state

* add: default min exit period

* refactor calculate_sft and remove unused alias

* refactor: add child_block_interval to GenServer state

* feat: add timestamp to persisted exit struct

* fix spec, revert formatting and remove single pipe

* fix: lint fail - duplicate keys in struct

* requested changes: defguardp, rename arguments and remove arg pattern match

* refactor: rename keys and use module struct for exit_info

* refactor: remove default min_exit_period & child_block_interval and update tests

* Making Child-chain work with fee feed (#1500)

* config changes

* hack: making ch-ch work with feefeed

* test: fix tests

* chore: restore barebone variables (no feed is running), small linter fixes

* test: try to fix ch-ch integration tests

* chore: restore deleted `updated_at` field

* test: api-level code for deposit.all endpoint

* add: deposit.all endpoint, controller, validator and views

* test: deposit.all controller

* refactor: length assertion

* refactor: get_events spec

* migration: initial supporting code

* migration: add eth_height to ethevents

* refactor and add: supporting code for migration

* add: start Ethereumex for migrations

* fix: lint

* refactor: re-scope modules from "ethevent" to "deposit" above DB.

* feat: persist eth_height in deposit event

* feat: persist eth_height in standard exit event

* tests: reflect addition of eth_height to persisted deposits

* refactor: Enum -> Stream

* fix: dialyzer spec error

* drop root_chain_txhash_event from returned object

* refactor: use Repo.stream

* add: Repo.transaction

* refactor: use of streams (pre-update)

* add: DB.Repo.transaction

* formatting

* fix: add eth_height to exit_consumer_test

* test: add eth_height to returned object

* add: eth_height to dialyzer spec

* add: eth_height to IFEs published to bus

* feat: swagger specs for /deposit.all

* tests: set async to true

* refactor: fetching eth_height as release task instead of migration

* tests: for add_eth_height_to_eth_events task

* feat: sort eth_events by descending eth_height

* fix: test name

* fix: lint & license

* fix: entrypoint command

* refactor: map.take instead of map.drop for clarity

* PR review suggested edits

* update: @moduledoc

* refactor: hex to int conversion

* PR review: order private/public functions

* PR review: refactor get_deposit to use case statement

* PR review: remove single pipe

* PR review: update dialyzer spec for get_events

* refactor: remove default arguments for get_events

* add: test for "lesser" validator

* refactor: ethevent variable declaration in insert_exit

* update deposit.all parameter validator to require "address" (& update tests)

* update get_deposits to require address (& update tests)

* update swagger spec to reflect non-optional address parameter

* refactor: scope  down get_events to get_deposits

* some final fixes

Co-authored-by: Pawel Nowosielski <pnowosie@users.noreply.github.com>
@unnawut unnawut added the enhancement New feature or request label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants