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

Enable eth_setPreferredAggregator #202

Merged
merged 1 commit into from
May 17, 2022
Merged

Enable eth_setPreferredAggregator #202

merged 1 commit into from
May 17, 2022

Conversation

voltrevo
Copy link
Collaborator

@voltrevo voltrevo commented May 17, 2022

What is this PR doing?

Adds new jrpc method eth_setPreferredAggregator which works like so:

await ethereum.request({
  method: 'eth_setPreferredAggregator',
  params: ['https://arbitrum-testnet.blswallet.org'],
});

This is part of the puzzle to allow dapps to pay for user transactions. In the manual test below we simply use the free aggregator, but this technique will allow a dapp to point to an aggregator which will aggregate only transactions for that dapp for free (in particular, by proxying a paid aggregator and including payment to tx.origin).

How can these changes be manually tested?

Configure your extension to use our new paid aggregator for arbitrum testnet:

AGGREGATOR_URL=https://arbitrum-testnet-paid.blswallet.org

Now at https://arbitrum-testnet.blswallet.org/billboard if you try to rent the billboard it'll get stuck forever in 'waiting for confirmation' because this aggregator expects to be paid.

Next, reload and set your preferred aggregator to the free aggregator in the console:

await ethereum.request({
  method: 'eth_setPreferredAggregator',
  params: ['https://arbitrum-testnet.blswallet.org'],
});

The result of this request should be the string 'ok', like this:

Screen Shot 2022-05-17 at 11 54 39 am

Then, try to rent the billboard again and this time it should be successful.

Does this PR resolve or contribute to any issues?

Resolves #170

Checklist

  • I have manually tested these changes
  • Post a link to the PR in the group chat

Guidelines

  • If your PR is not ready, mark it as a draft
  • The resolve conversation button is for reviewers, not authors
    • (But add a 'done' comment or similar)

@github-actions github-actions bot added the extension Browser extension related label May 17, 2022
@jacque006 jacque006 merged commit 43d39ef into main May 17, 2022
@jacque006 jacque006 deleted the use-custom-aggregator branch May 17, 2022 23:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extension Browser extension related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create example dapp that uses bls-wallet and pays user txs
2 participants