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: let fromHeight of 0 mean the latest block instead of the genesis… #583

Merged
merged 2 commits into from
May 6, 2022

Conversation

niklr
Copy link
Contributor

@niklr niklr commented Mar 31, 2022

What kind of change does this PR introduce? (check at least one)

  • Improvement
  • Bugfix
  • Feature
  • Refactor
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

Current dapps or scripts could break if they assume startHeight = 0 will return all events since genesis block.

@niklr
Copy link
Contributor Author

niklr commented Mar 31, 2022

Solves #579 partially.

@viteshan
Copy link
Collaborator

viteshan commented Apr 6, 2022

This modification will cause confusion to users who are currently using it.

@niklr
Copy link
Contributor Author

niklr commented Apr 22, 2022

Both RPC methods ledger_getVmLogsByFilter and subscribe_getLogs have been extended with the optional pageIndex and pageSize pagination parameters. It can be tested as follows:

let logs = await provider.request("ledger_getVmLogsByFilter",
  {
    "addressHeightRange": {
      [a.address]: {
        "fromHeight": "1",
        "toHeight": "0"
      }
    },
    pageIndex: 1,
    pageSize: 6
  });

I have to say I'm not a fan of those changes. Instead we should just abort the request (return error in for loop) if a certain time limit (e.g. >=3000ms) is exceeded. What do you think @charles-liu @viteshan?

@viteshan viteshan merged commit 0b27915 into vitelabs:master May 6, 2022
@niklr niklr mentioned this pull request Aug 11, 2022
7 tasks
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.

2 participants