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

fix: remove source code fields from list endpoint #1920

Merged
merged 3 commits into from
May 12, 2019

Conversation

zachdaniel
Copy link
Contributor

@zachdaniel zachdaniel commented May 8, 2019

Resolves #1894

Displaying full source code and decompiled source code in the contract endpoint results in massive payloads and a very slow endpoint. This updates the list endpoint to not show the source code and decompiled source code fields. In order to get those fields one has to use the getsourcecode action.

Changelog

Bug Fixes

  • Fix performance issue of rendering source code + decompiled source code in the contract list endpoint

Incompatible Changes

  • This is a new endpoint, so I don't think we need to worry too much about changes (especially since it was almost unusable up until now), but it is technically removing a field from an API endpoint, so something to consider.

    • I added an entry to CHANGELOG.md with this PR
    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
    • I checked whether I should update the docs and did so if necessary

@ghost ghost assigned zachdaniel May 8, 2019
@ghost ghost added the in progress label May 8, 2019
@zachdaniel zachdaniel force-pushed the smart-contract-filter-performance branch from 98821b6 to 1d2c11c Compare May 8, 2019 18:47
@coveralls
Copy link

coveralls commented May 8, 2019

Pull Request Test Coverage Report for Build 1776bfd7-ca14-4949-a3f1-72bc1b7dbe83

  • 15 of 18 (83.33%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.06%) to 81.829%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex 6 7 85.71%
apps/explorer/lib/explorer/chain.ex 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
apps/block_scout_web/lib/block_scout_web/views/api/rpc/contract_view.ex 1 96.43%
apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/contract_controller.ex 1 84.75%
Totals Coverage Status
Change from base Build 0164a398-f3d3-42fa-9434-4cfc67196199: 0.06%
Covered Lines: 4643
Relevant Lines: 5674

💛 - Coveralls

@ghost ghost assigned vbaranov May 9, 2019
@vbaranov vbaranov merged commit 8a74603 into master May 12, 2019
@ghost ghost removed the in progress label May 12, 2019
@vbaranov vbaranov deleted the smart-contract-filter-performance branch May 12, 2019 10:01
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.

Slow performance of contracts list endpoint with an included filter
4 participants