Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Keep track of block gasLimit #3506

Merged
merged 2 commits into from
Nov 18, 2016
Merged

Keep track of block gasLimit #3506

merged 2 commits into from
Nov 18, 2016

Conversation

jacogr
Copy link
Contributor

@jacogr jacogr commented Nov 18, 2016

  • Retrieve gasLimit on new block subscription
  • To be used in contract execute/transactions to determine too high costs (to warn user)

@ngotchac Please take a look, this should fit in with the optimisation approach you are taking, if not need to tweak this PR

@jacogr jacogr added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Nov 18, 2016
this._api.eth
.getBlockByNumber(blockNumber)
.then((block) => {
this._store.dispatch(statusCollection({ gasLimit: block.gasLimit }));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we store any other informations back from this request ? I know we are fetching timestamps for transactions from the blockNumber, we might want to store it.. Or not... It should take only 50kB of memory for one day of data, might be worth it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking the same. However I would rather not store for the sake of storing - so rather when we have a need for it, come and extract it as opposed to extract it and look for a use at some point down the line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 18, 2016
@ngotchac ngotchac merged commit aa43990 into master Nov 18, 2016
@ngotchac ngotchac deleted the jg-block-gasLimit branch November 18, 2016 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants