Skip to content

Instantly share code, notes, and snippets.

@rjchow
Last active February 7, 2021 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjchow/661f4155a6bda8ea544d259353a8c37d to your computer and use it in GitHub Desktop.
Save rjchow/661f4155a6bda8ea544d259353a8c37d to your computer and use it in GitHub Desktop.
ETHDenver2021 Talks
infura transaction service
https://www.youtube.com/watch?v=BmghRUEJtJ4
fee market to entice miners
stuck transactions -> when there are too many transactions, even with high fees
problems
#1 transactions get dropped by network
nonce gap (nonce must strictly increment by 1) -> dropped transaction blocks all transactions that depend on it
#2 transaction queues get stuck
if a low fee paying transaction is stuck, all later transactions you send will be stuck too
#3 bad fee management
many players set a high fixed fee which is overpaying during non-congestion
----
Dedicated inhouse relayers solve some of these problems but at a high operational cost
Infura transaction relays try to solve this problem
outsource the transaction infrastructure to infura to guarantee transaction delivery
how?
republish periodically to guarantee its always picked up
organise all transaction queues in descending order with highest fee first
real time fee adjustments, tx are sent at estimated fee which is gradually bumped until it is processed
-------
ITX audience
crypto wallet providers -> one stuck tx holds up thousands of tx for other users
sequencers and rollup providers -> sending gas intensive tx need to compete in network fee market
sever side scripts and defi bots -> need to send tx periodically or in response to on-chain event
dapps -> users complaining about stuck transactions?
---------
how to use itx?
deposit eth (to on chain contract) to cover gas fee
eth account (signing key) to authenticate expenditure
script that sends tx to network
new json rpc commands
relay_getBalance : fetches gas tank balance
relay_sendTransaction : sends a pre-signed relay transaction (input is not the actual signed transaction, but a signed message)
relay_getTransactionStatus: fetches a list of broadcast eth transactions for a given relay transaction hash
live demo showed a main net transaction being mined at 116gwei when eth gas station said the current fast rate is 176gwei
------------
limitations:
msg.sender is the relayer address and not eth account
- no eth transfers allowed
- erc20 require pre-approval to use this service
solution:
- meta tx capable contracts
- using wallet contracts instead of eoa wallets
------------
my thoughts:
- not really directly usable for us because of msg.sender problem -> but we can use it if we meta-tx enable our contracts
- we can use (gsn) relaying to fix our sequential multi transaction problems instead of using ds proxy?
extending web3 provider for better ux
https://www.youtube.com/watch?v=tCKLeP0ufyQ
tl;dr portis is like a in-browser metamask which uses email/password to login
just read https://www.portis.io/ instead of watching this
+ it works on mobile
+ has direct eth purchase feature using credit card payment
+ has gsn support (not sure how updated because they refer to it as eip1613 which is a very outdated term)
- the encrypted wallet is held with portis instead of in-browser
(gitcoin uses them)
extra notes:
dApps differ from web2 flows because of the user holding their own private keys
web3 provider wraps a web3 instance and provides an interface for dapps to interact with a web3 compliant node
it lets users do the same thing they can do as if they had their own node instance, but with their own private key in a secure manner (i.e without exposing their private key to anyone else besides their provider)
balance between security and usability
power user who need to fiddle with the parameters vs mainstream users who just want to tx
portis is a standard web3 provider, works the same way as metamask
authenticated methods vs unauthenticated methods
(requires exposing the user's identity or using his private keys) vs reading data from the blockchain
portis only loads stuff upon authenticated methods being called, otherwise it stays out of the way
dapp initialises portis with 3 options
scope : like oauth scopes, currently {reputation, email}
network : homestead, ropsten, rinkeby etc
dappId : set up logo etc, and also domain that portis should be allowed to run on
further thoughts:
we could set up a provider proxy for testnets that automatically tops up accounts if it detects that the account does not have enough eth for tx?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment