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

feat: Adds draft design doc for new endpoints #3342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

konstantinabl
Copy link
Collaborator

Description:

Related issue(s):

Fixes #3340

Notes for reviewer:

@konstantinabl konstantinabl linked an issue Dec 18, 2024 that may be closed by this pull request
@konstantinabl konstantinabl self-assigned this Dec 18, 2024
@konstantinabl konstantinabl added the design Design, pilot and prototyping exploration work label Dec 18, 2024
@konstantinabl konstantinabl added this to the 0.63.0 milestone Dec 18, 2024
Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl force-pushed the 3340-create-design-doc-to-support-rest-api branch from 7088d1c to b840444 Compare December 18, 2024 17:40
Copy link

github-actions bot commented Dec 18, 2024

Test Results

 21 files   -   2  297 suites   - 52   48m 40s ⏱️ -32s
613 tests  -   4  607 ✅ +  4  4 💤 ±0  2 ❌  -  8 
779 runs   - 130  770 ✅  - 119  6 💤  - 1  3 ❌  - 10 

For more details on these failures, see this check.

Results for commit b840444. ± Comparison against base commit 13d09e9.

This pull request removes 4 tests.
"before all" hook for "emits an approval event" ‑ RPC Server Acceptance Tests Acceptance tests @erc20 Acceptance Tests HTS token should behave like erc20 transfer from when the token owner is not the zero address when the recipient is not the zero address when the spender has enough allowance "before all" hook for "emits an approval event"
"before all" hook for "reverts" ‑ RPC Server Acceptance Tests Acceptance tests @erc20 Acceptance Tests HTS token should behave like erc20 transfer from when the token owner is not the zero address when the recipient is not the zero address when the spender does not have enough allowance when the token owner has enough balance "before all" hook for "reverts"
"before each" hook for "reverts" ‑ RPC Server Acceptance Tests Acceptance tests @erc20 Acceptance Tests HTS token should behave like erc20 transfer from when the token owner is not the zero address when the recipient is not the zero address when the spender does not have enough allowance "before each" hook for "reverts"
"before each" hook for "should execute "eth_getStorageAt" request to get current state changes" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests "before each" hook for "should execute "eth_getStorageAt" request to get current state changes"

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.96%. Comparing base (13d09e9) to head (b840444).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3342      +/-   ##
==========================================
- Coverage   85.04%   84.96%   -0.09%     
==========================================
  Files          65       69       +4     
  Lines        4508     4688     +180     
  Branches     1023     1050      +27     
==========================================
+ Hits         3834     3983     +149     
- Misses        330      393      +63     
+ Partials      344      312      -32     
Flag Coverage Δ
config-service 98.14% <ø> (ø)
relay 79.72% <ø> (ø)
server 83.28% <ø> (?)
ws-server 36.66% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/relay/src/lib/eth.ts 86.14% <ø> (ø)

... and 15 files with indirect coverage changes

@konstantinabl konstantinabl marked this pull request as ready for review December 18, 2024 22:41
@konstantinabl konstantinabl requested review from a team as code owners December 18, 2024 22:41
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Good start.
I think we have to think through the way in which this would deploy and scale a bit more.

@@ -0,0 +1,160 @@
# Design Document: ERC20/ERC721/ERC1155 Token Transfer Events API, Tokens Owned by an Address
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would name it Block Explorer API Support

# Design Document: ERC20/ERC721/ERC1155 Token Transfer Events API, Tokens Owned by an Address

## Overview
- This document outlines the design for implementing new endpoints allowing exposure of more EVM centric data, similar to Etherscan's and BlockScout's APIs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- This document outlines the design for implementing new endpoints allowing exposure of more EVM centric data, similar to Etherscan's and BlockScout's APIs.
- This document outlines the design for implementing new endpoints allowing exposure of more EVM centric data that support Block Explorer (e.g. Etherscan, BlockScout) API needs.

- Match Etherscan's response format for easy integration
- Maintain performance with large datasets
- Provide endpoints to fetch tokens owned by an address

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add Non-Goals, noting that complete API support of existing EthereScan and BlockScout APIs.
As we expand we'll address gaps


## `getTokenTransfers`

### Components
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be a new package not under relay.
We want it to be a separate deployable service so that it can be scaled separately from the relay and not impact the core APIs

If not the alternative is make endpoint support configureable so that a deployemnt can decide to support explorer APIs only or along with core APIs

### Overview

Introduce two new endpoints:
- `getTokenTransfers` - to fetch token transfer events
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: what are the params?
You should move the params explanation lower to here.
Also note what's mandatory

- Test address matching
- Test token standard detection

2. **Acceptance Tests**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Acceptance tests should be in teh form of E2E features a User would go through with a focus on the input and the outputs


### Dependencies

- ERC registry
Copy link
Collaborator

Choose a reason for hiding this comment

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

How so, please expand

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Good start waiting on a bit more structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design, pilot and prototyping exploration work
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Create design doc to support REST API
2 participants