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

Timeboost mode for nitro-testnode #95

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

Tristan-Wilson
Copy link
Member

@Tristan-Wilson Tristan-Wilson commented Oct 21, 2024

This PR adds support for timeboost mode on nitro-testnode. It starts the bid-validator, autonomous auctioneer, deploys the ExpressLaneAuction contract, and starts the sequencer in Timeboost mode.

Since Timeboost is not yet merged into the main nitro or contracts branches, currently you will need to follow the following steps to run nitro-testnode in Timeboost mode. (This will improve once things are merged in.)

  • checkout nitro, branch: express-lane-timeboost
  • In the nitro dir, go into the contracts submodule and check out express-lane-auction
    • run yarn build:all inside this directory
  • In the nitro dir, go into the nitro-testnode submodule and check out timeboost-mode
    • From this directory, run DEFAULT_NITRO_CONTRACTS_VERSION=bec7d629c5f4a9dc4ec786e9d6e99734a11d109b ./test-node.bash --init-force --dev --dev-contracts --l2-timeboost

When starting up, look for the line printing the token and contract address:

== Bidding token: $biddingTokenAddress, auction contract $auctionContractAddress

You can also find the auction contract and auctioneer address with the following command.

$ docker compose run --entrypoint sh sequencer -c "cat /config/sequencer_config.json" | jq .execution.sequencer
 ✔ Container nitro-testnode-geth-1  Running0.0s 
{
  "enable": true,
  "timeboost": {
    "enable": true,
    "auction-contract-address": "0x7DD3F2a3fAeF3B9F2364c335163244D3388Feb83",
    "auctioneer-address": "0x46225F4cee2b4A1d506C7f894bb3dAeB21BF1596"
  }
}

Users alice and bob have been pre-funded with some of the bidding token on L2 and can be used right away.

$ docker compose run scripts print-private-key --account user_alice
...
$ docker compose run scripts print-private-key --account user_bob
...

# make a deposit into the ExpressLaneAuction contract
$ docker compose run  --entrypoint /usr/local/bin/bidder-client timeboost-bid-validator --auction-contract-address 0x... --deposit-gwei 1000000000  --wallet.private-key <alice or bob private key, no 0x> --arbitrum-node-endpoint http://sequencer:8547

# make a bid for control of the next express lane round
$ docker compose run  --entrypoint /usr/local/bin/bidder-client timeboost-bid-validator --auction-contract-address 0x... --bid-gwei 1 --wallet.private-key <alice or bob private key, no 0x> --arbitrum-node-endpoint http://sequencer:8547 --bid-validator-endpoint http://timeboost-bid-validator:8547 

Commands for sending express lane transactions will be provided in future, see implementation and spec .

This adds a command for deploying the ExpressLaneAuction contract:
docker compose run scripts deploy-express-lane-auction

Since the contracts branch with ExpressLaneAuction is not published to
NPM this commit adds a way for it to be included from the local
workspace into the scripts docker image with the --dev-contracts flag.
The bash and docker logic here needs to be cleaned up so that it will
use the NPM version when not using the --dev-contracts flag.

The commit includes WIP code for initializing the contract.
Open ports and set up auth endpoint correctly on sequencer.
Deploy auction contract with l2owner instead of auctioneer accounts
(admin account on proxy contract cannot make calls on the proxied-to
contract).
@cla-bot cla-bot bot added the s label Oct 21, 2024
@Tristan-Wilson Tristan-Wilson marked this pull request as ready for review October 21, 2024 15:19
@Tristan-Wilson
Copy link
Member Author

Changed the recommended nitro branch to express-lane-timeboost for now since it will get fixes.

Even if using an nitro image that doesn't have timeboost enabled yet,
nitro will still start after logging an error message.
Unavailable modules in HTTP API list     unavailable=[timeboost] available="[admin debug web3 eth txpool personal net arb arbdebug arbtrace]"
ReserveSubmissionSeconds represents a period BEFORE the auction closes
that the reserve price may be updated for the next round. The previous
setting of 45 seconds means that the reserve price could not be updated
at all after the round started, coupled with the auction closing period
of 15 seconds (round duration is 60 seconds).
@Tristan-Wilson
Copy link
Member Author

Instructions updated for latest nitro express-lane-timeboost branch.

@@ -6,7 +6,7 @@ NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.2.1-d81324d-dev
BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8

# This commit matches v2.1.0 release of nitro-contracts, with additional support to set arb owner through upgrade executor
DEFAULT_NITRO_CONTRACTS_VERSION="99c07a7db2fcce75b751c5a2bd4936e898cda065"
DEFAULT_NITRO_CONTRACTS_VERSION="bec7d629c5f4a9dc4ec786e9d6e99734a11d109b"
Copy link
Member

Choose a reason for hiding this comment

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

you can use this release with timeboost contracts now

Suggested change
DEFAULT_NITRO_CONTRACTS_VERSION="bec7d629c5f4a9dc4ec786e9d6e99734a11d109b"
DEFAULT_NITRO_CONTRACTS_VERSION="v2.1.1"

@@ -6,6 +6,7 @@
"author": "Offchain Labs, Inc.",
"license": "Apache-2.0",
"dependencies": {
"@arbitrum/nitro-contracts": "^2.1.0",
Copy link
Member

Choose a reason for hiding this comment

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

This version would have the timeboost contracts and you don't need to do the dev-contract hack

Suggested change
"@arbitrum/nitro-contracts": "^2.1.0",
"@arbitrum/nitro-contracts": "^2.1.1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants