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

Support blockTag #5

Open
xrchz opened this issue Jun 7, 2024 · 2 comments
Open

Support blockTag #5

xrchz opened this issue Jun 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@xrchz
Copy link

xrchz commented Jun 7, 2024

Currently it looks like the multicall provider ignores the {blockTag} extra argument on calls. It should instead support this - and ideally throw an error if the underlying provider does not support specifying a block tag.

@ricmoo
Copy link
Member

ricmoo commented Jun 7, 2024

Completely agree. :)

I will look at it this weekend/next week.

ricmoo added a commit that referenced this issue Jun 16, 2024
@ricmoo
Copy link
Member

ricmoo commented Jun 16, 2024

This should now be supported.

I've tested it against Infura (for near blocks) and it works.

The contract was already set up to handle it, so it was just a matter of splitting up the requests.

This also has an added bonus:

Normally, if a node doesn't support archive access it simply ignores the blockTag and returns "latest", silently providing wrong data. With this, the multi call contract includes the blockTag from the call along with the results, so the provider can check that the node honoured the blockTag parameter and will throw if the node is lying about what block the data is from.

Anyways, please try it out and let me know if it works for you and I'll publish to npm. :)

@ricmoo ricmoo added the enhancement New feature or request label Jun 16, 2024
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

No branches or pull requests

2 participants