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

decrease token metadata update interval #1691

Merged
merged 11 commits into from
Apr 2, 2019

Conversation

ayrat555
Copy link
Contributor

@ayrat555 ayrat555 commented Apr 1, 2019

fixes #1689

Motivation

Update interval for token metadata is one week. The app is being deployed more often recently so token metadata cannot be updated.

Changelog

  • decrease token metadata update interval to 2 days

@ghost ghost assigned ayrat555 Apr 1, 2019
@ghost ghost added the in progress label Apr 1, 2019
@ayrat555 ayrat555 requested review from goodsoft and zachdaniel April 1, 2019 13:35
@goodsoft
Copy link
Contributor

goodsoft commented Apr 1, 2019

Triggering supply update when we encounter a token transfer in indexer seems to be a better idea to me

@coveralls
Copy link

coveralls commented Apr 1, 2019

Pull Request Test Coverage Report for Build ee7b562b-e559-4f77-aaaa-fecfae6ca2ab

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 83.007%

Totals Coverage Status
Change from base Build 1f5b0e33-37b6-4444-92b8-af666d69aaaf: 0.06%
Covered Lines: 4445
Relevant Lines: 5355

💛 - Coveralls

@ayrat555
Copy link
Contributor Author

ayrat555 commented Apr 1, 2019

I can add it but we still need fetching in the controller because there are already a lot stale tokens

@goodsoft
Copy link
Contributor

goodsoft commented Apr 1, 2019

If I understand correctly, the complete update of all of them should be triggered by application server restart anyway.

@ayrat555
Copy link
Contributor Author

ayrat555 commented Apr 1, 2019

no, it'll be 2 days after the restart

@goodsoft
Copy link
Contributor

goodsoft commented Apr 1, 2019

It sends a message to itself immediately.

My point is, we should strive to import blocks with most of relevant metadata in near-realtime on a steady and predictable pace. This way we won't need to add ad-hoc out-of-band requests from frontend to indexer.

The problem with such requests is that they create an attack vector by exposing indexer to outer world and allowing external users to influence its request rate.

@ayrat555 ayrat555 changed the title decrease token metadata update interval and fetch metadata in controller decrease token metadata update interval Apr 2, 2019
@@ -13,19 +13,13 @@ defmodule Indexer.Token.FetcherTest do
describe "init/3" do
test "returns uncataloged tokens", %{json_rpc_named_arguments: json_rpc_named_arguments} do
insert(:token, cataloged: true)
%Token{contract_address_hash: uncatalog_address} = insert(:token, cataloged: false)
%Token{contract_address_hash: uncatalog_address} = insert(:token, cataloged: false) |> IO.inspect()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IO.inspect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad

@ayrat555 ayrat555 merged commit 83e229e into master Apr 2, 2019
@ghost ghost removed the in progress label Apr 2, 2019
@ayrat555 ayrat555 deleted the ab-decrease-token-update-interval branch April 2, 2019 14:19
@vbaranov vbaranov mentioned this pull request Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong total supply percentage on token holders page
4 participants