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

Attempt to evaluate a gas price before relaying a call #105

Merged
merged 4 commits into from
Feb 28, 2019
Merged

Attempt to evaluate a gas price before relaying a call #105

merged 4 commits into from
Feb 28, 2019

Conversation

forshtat
Copy link
Contributor

I believe this is a safer way to estimate gas price, even though the "web3.eth.getGasPrice" is not reliable in xdai network, the relays will rely on it anyways.
P.S. I did not test this change thoroughly, still having issues just running Burner Wallet.

Copy link

@drortirosh drortirosh left a comment

Choose a reason for hiding this comment

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

The problem is that if there are to many such relayed calls (compared to normal non-relayed calls) which suggest average1.3 the average will raise...
Need to fix the RelayClient so that it will try to use by default the suggested minGas offered by the relay, up to (say) current
1.2.

@riusricardo
Copy link
Contributor

riusricardo commented Feb 27, 2019

I agree on this. There is an issue caused by 0 Txs avg in gas calculation.

Parity Ethereum #9795

@riusricardo
Copy link
Contributor

riusricardo commented Feb 27, 2019

@alex-forshtat-tbk @shahafn the latest commit looks to be a misunderstanding in the code.
msg.sender is used to log the fund creator not the claimer which should not be the relay.
Or did I missed something?

It is also important to keep the fund creator here because after the link expires, they'll be the only ones able to claim the link.
Changing "msg.sender" to "get_sender()" since it's RelayRecipient

@drortirosh
Copy link

drortirosh commented Feb 27, 2019 via email

@riusricardo
Copy link
Contributor

riusricardo commented Feb 27, 2019

@drortirosh Great! Thanks for clarifying. So it is good to have it. Very useful for sending tokens.

@shahafn
Copy link
Contributor

shahafn commented Feb 27, 2019

@riusricardo Another issue that should be noted: RelayRecipient.sol should be on top of the inheritance hierarchy, since if Links.sol calls Vault.sol's functions that might use msg.sender in a relayed call, they should be replaced with get_sender() as well.

@riusricardo
Copy link
Contributor

riusricardo commented Feb 27, 2019

@shahafn that sounds good to me. I kept Vault as the the most base-like because is the one that handles the value. But if you need to change the order, feel free to do it.
Vault is only used in the Links SC, so you can also change it to use the get_sender() function.

Now vault can be used via relayed calls
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.

5 participants