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

Filling-in optional fields of TransactionRequest... #1305

Merged
merged 20 commits into from
Jun 18, 2016

Conversation

tomusdrw
Copy link
Collaborator

...before sending to Signer UI

Tomasz Drwięga and others added 17 commits June 15, 2016 00:17
* Deactivate peer if it has no new data

* Fixed node table timer registration

* Fixed handshake timeout expiration

* Extra trace

* Fixed session count calculation

* Only deactivate incapable peers in ChainHead state

* Timer registration is not needed
x64 program files path for installer
firewall rules for windows installer
Re-ahead 8 bytes rather than 3 to ensure large blocks import fine.
* Gas price statistics.

Affects eth_gasPrice.
Added ethcore_gasPriceStatistics.

Closes #1265

* Fix a bug in eth_gasPrice

* Fix tests.

* Revert minor alteration.

* Tests for gas_price_statistics.

- Tests;
- Additional infrastructure for generating test blocks with
transactions.
More meaningful errors when sending transaction
* avoid warning with key

* fix intendations

* more intendation fix

* ok() instead of expect()
@tomusdrw tomusdrw added the A0-pleasereview 🤓 Pull request needs code review. label Jun 16, 2016
@GitCop
Copy link

GitCop commented Jun 16, 2016

There were the following issues with your Pull Request

  • Commit: 1a6add8
    • Your subject line is longer than 72 characters

Guidelines are available at https://github.com/ethcore/parity


This message was auto-generated by https://gitcop.com

2 similar comments
@GitCop
Copy link

GitCop commented Jun 16, 2016

There were the following issues with your Pull Request

  • Commit: 1a6add8
    • Your subject line is longer than 72 characters

Guidelines are available at https://github.com/ethcore/parity


This message was auto-generated by https://gitcop.com

@GitCop
Copy link

GitCop commented Jun 16, 2016

There were the following issues with your Pull Request

  • Commit: 1a6add8
    • Your subject line is longer than 72 characters

Guidelines are available at https://github.com/ethcore/parity


This message was auto-generated by https://gitcop.com

request.gas = Some(miner.sensible_gas_limit());
}
if let None = request.gas_price {
request.gas_price = Some(miner.sensible_gas_price());
Copy link
Contributor

Choose a reason for hiding this comment

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

trace! to help with the reasons that request state mutated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's added in ../impls/mod.rs when sending transaction anyhow, it's not really muted it's just filled in (cause dapp developer left this to us to fill reasonable default)

Copy link
Contributor

Choose a reason for hiding this comment

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

well note that value comes from some algorithm and was not set by the user can be helpful, but it's up to you

@NikVolf NikVolf added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 16, 2016
@NikVolf NikVolf added A0-pleasereview 🤓 Pull request needs code review. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Jun 16, 2016
@NikVolf
Copy link
Contributor

NikVolf commented Jun 16, 2016

continuous-integration/appveyor/branch fail can be ignored

}
}

fn fill_optional_fields(&self, miner: Arc<M>, mut request: TransactionRequest) -> TransactionRequest {
Copy link
Contributor

@rphmeier rphmeier Jun 16, 2016

Choose a reason for hiding this comment

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

could be worthwhile at some point to make a type-level distinction between requests with fields potentially missing and fully fleshed-out requests, making it impossible to even attempt to use one which isn't complete.

Copy link
Collaborator Author

@tomusdrw tomusdrw Jun 17, 2016

Choose a reason for hiding this comment

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

Yup. In fact it would be best to fill those options in UI, but some of the stuff is not exposed yet. I will create an issue to refactor this part in the (near/post-release) future.

@gavofyork gavofyork modified the milestone: 1.2 Security Jun 16, 2016
@gavofyork
Copy link
Contributor

Failed test: v1::tests::mocked::eth_signing::should_add_transaction_to_queue

@gavofyork gavofyork added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 18, 2016
Tomasz Drwięga added 2 commits June 18, 2016 11:38
Conflicts:
	rpc/src/v1/impls/eth_signing.rs
	rpc/src/v1/impls/mod.rs
	sync/src/chain.rs
@tomusdrw tomusdrw added A0-pleasereview 🤓 Pull request needs code review. and removed A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Jun 18, 2016

fn fill_optional_fields(&self, miner: Arc<M>, mut request: TransactionRequest) -> TransactionRequest {
if let None = request.gas {
request.gas = Some(miner.sensible_gas_limit());
Copy link
Contributor

@gavofyork gavofyork Jun 18, 2016

Choose a reason for hiding this comment

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

no - miner.sensible_gas_price is now a fallback and should no longer be used directly. see the implementation of fn default_gas_price() in eth.rs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The logic here is the same as in impls/mod.rs#sign_and_dispatch, using signer does not change this behaviour.
Replacing this can go in a separate PR.

@gavofyork gavofyork added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Jun 18, 2016
@gavofyork gavofyork merged commit 5e1e3ce into master Jun 18, 2016
@tomusdrw tomusdrw deleted the signer-fill-optionals branch June 20, 2016 13:48
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.

7 participants