Skip to content

Commit

Permalink
Merge pull request OffchainLabs#22 from EspressoSystems/jh/sync
Browse files Browse the repository at this point in the history
Sync upstream 20240315
  • Loading branch information
ImJeremyHe authored Mar 15, 2024
2 parents d74eb69 + 3b906de commit 3fd5f4b
Show file tree
Hide file tree
Showing 14 changed files with 2,712 additions and 198 deletions.
10 changes: 5 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG=true
# A special account for `espresso-sequencer`, check `scripts/accounts.ts` for details.
ESPRESSO_COMMITMENT_ETH_MNEMONIC="indoor dish desk flag debris potato excuse depart ticket judge file exit"
ESPRESSO_SEQUENCER_ETH_MNEMONIC="test test test test test test test test test test test junk"
ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=5
ESPRESSO_SEQUENCER_HOTSHOT_ACCOUNT_INDEX=6
ESPRESSO_COMMITMENT_TASK_PORT=60000

# Example sequencer demo private keys
ESPRESSO_DEMO_SEQUENCER_PRIVATE_STAKING_KEY_0=BLS_SIGNING_KEY~lNDh4Pn-pTAyzyprOAFdXHwhrKhEwqwtMtkD3CZF4x3o
ESPRESSO_DEMO_SEQUENCER_PRIVATE_STAKING_KEY_1=BLS_SIGNING_KEY~-DO72m_SFl6NQMYknm05FYpPEklkeqz-B3g2mFdbuS83
ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_0=BLS_SIGNING_KEY~lNDh4Pn-pTAyzyprOAFdXHwhrKhEwqwtMtkD3CZF4x3o
ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_1=BLS_SIGNING_KEY~-DO72m_SFl6NQMYknm05FYpPEklkeqz-B3g2mFdbuS83

ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_0=STATEKEY~YC2YwzvFypi98JLHHEydp6EGMkcSsEZBEnByNBnajgE-
ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1=STATEKEY~5JJJJ9OhX320me8TUKZ15iRTVHslYyULwlDm3FG5vAOk
ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_0=SCHNORR_SIGNING_KEY~XxPSER8Vh3nFj_m7cUQ--96JfKrycrSKyRQximkQigCo
ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1=SCHNORR_SIGNING_KEY~2NpKtvY5F0u1LWgYws-JeX1vDdp5CfECuaMMYxyz4gDM

ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX=8
ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS=0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ For help and further scripts, see:
./test-node.bash script --help
```

## Named accounts

```bash
./test-node.bash script print-address --account sequencer
```
```
sequencer: 0xe2148eE53c0755215Df69b2616E552154EdC584f
validator: 0x6A568afe0f82d34759347bb36F14A6bB171d2CBe
l2owner: 0x5E1497dD1f08C87b2d8FE23e9AAB6c1De833D927
l3owner: 0x863c904166E801527125D8672442D736194A3362
l3sequencer: 0x3E6134aAD4C4d422FF2A4391Dc315c4DDf98D1a5
user_l1user: 0x058E6C774025ade66153C65672219191c72c7095
user_token_bridge_deployer: 0x3EaCb30f025630857aDffac9B2366F953eFE4F98
user_fee_token_deployer: 0x2AC5278D230f88B481bBE4A94751d7188ef48Ca2
```

While not a named account, 0x3f1eae7d46d88f08fc2f8ed27fcb2ab183eb2d0e is funded on all test chains.

## Contact

Discord - [Arbitrum](https://discord.com/invite/5KE54JwyTs)
Expand Down
31 changes: 16 additions & 15 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ services:
- "127.0.0.1:9642:9642"
volumes:
- "seqdata:/home/user/.arbitrum/local/nitro"
- "l1keystore:/home/user/l1keystore"
- "config:/config"
- "tokenbridge-data:/tokenbridge-data"
command: --conf.file /config/sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain *
depends_on:
- geth
- redis

sequencer_b:
pid: host # allow debugging
Expand Down Expand Up @@ -312,8 +313,7 @@ services:
volumes:
- "l1keystore:/home/user/l1keystore"
- "config:/config"
depends_on:
- redis
- "tokenbridge-data:/tokenbridge-data"

relay:
pid: host
Expand All @@ -333,11 +333,11 @@ services:
- ARB_URL=http://sequencer:8547
- ETH_URL=http://geth:8545
volumes:
- "sdk-data:/workspace"
- "tokenbridge-data:/workspace"
- /var/run/docker.sock:/var/run/docker.sock

orchestrator:
image: ghcr.io/espressosystems/espresso-sequencer/orchestrator:main
image: ghcr.io/espressosystems/espresso-sequencer/orchestrator:arbitrum-integrationmusl
ports:
- "$ESPRESSO_ORCHESTRATOR_PORT:$ESPRESSO_ORCHESTRATOR_PORT"
environment:
Expand All @@ -352,7 +352,7 @@ services:
- RUST_LOG_FORMAT

da-server:
image: ghcr.io/espressosystems/espresso-sequencer/web-server:main
image: ghcr.io/espressosystems/espresso-sequencer/web-server:arbitrum-integrationmusl
ports:
- "$ESPRESSO_DA_SERVER_PORT:$ESPRESSO_WEB_SERVER_PORT"
environment:
Expand All @@ -364,7 +364,7 @@ services:
condition: service_healthy

consensus-server:
image: ghcr.io/espressosystems/espresso-sequencer/web-server:main
image: ghcr.io/espressosystems/espresso-sequencer/web-server:arbitrum-integrationmusl
ports:
- "$ESPRESSO_CONSENSUS_SERVER_PORT:$ESPRESSO_WEB_SERVER_PORT"
environment:
Expand All @@ -376,7 +376,7 @@ services:
condition: service_healthy

espresso-sequencer0:
image: ghcr.io/espressosystems/espresso-sequencer/sequencer:main
image: ghcr.io/espressosystems/espresso-sequencer/sequencer:arbitrum-integrationmusl
ports:
- "$ESPRESSO_SEQUENCER_API_PORT:$ESPRESSO_SEQUENCER_API_PORT"
# Run the API server (with options taken from the environment) and the optional submission API
Expand All @@ -389,12 +389,13 @@ services:
- ESPRESSO_SEQUENCER_STORAGE_PATH
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_PRIVATE_STAKING_KEY_0
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_0
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_0
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1
- ESPRESSO_STATE_RELAY_SERVER_URL
- ESPRESSO_SEQUENCER_ETH_MNEMONIC
- ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX
- ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS
- ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer1:$ESPRESSO_SEQUENCER_API_PORT
- RUST_LOG
- RUST_LOG_FORMAT
depends_on:
Expand All @@ -408,7 +409,7 @@ services:
condition: service_started

espresso-sequencer1:
image: ghcr.io/espressosystems/espresso-sequencer/sequencer:main
image: ghcr.io/espressosystems/espresso-sequencer/sequencer:arbitrum-integrationmusl
ports:
- "$ESPRESSO_SEQUENCER1_API_PORT:$ESPRESSO_SEQUENCER_API_PORT"
# Run the API server (with options taken from the environment)
Expand All @@ -420,14 +421,14 @@ services:
- ESPRESSO_SEQUENCER_STORAGE_PATH
- ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_SEQUENCER_L1_USE_LATEST_BLOCK_TAG
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_PRIVATE_STAKING_KEY_1
- ESPRESSO_SEQUENCER_PRIVATE_STAKING_KEY=$ESPRESSO_DEMO_SEQUENCER_STAKING_PRIVATE_KEY_1
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_1
- ESPRESSO_SEQUENCER_ETH_MNEMONIC
- ESPRESSO_SEQUENCER_ETH_ACCOUNT_INDEX
- ESPRESSO_SEQUENCER_PREFUNDED_BUILDER_ACCOUNTS
- ESPRESSO_STATE_RELAY_SERVER_URL
- RUST_LOG
- RUST_LOG_FORMAT
- ESPRESSO_SEQUENCER_STATE_PEERS=http://espresso-sequencer0:$ESPRESSO_SEQUENCER_API_PORT
depends_on:
orchestrator:
condition: service_healthy
Expand All @@ -439,7 +440,7 @@ services:
condition: service_started

commitment-task:
image: ghcr.io/espressosystems/espresso-sequencer/commitment-task:main
image: ghcr.io/espressosystems/espresso-sequencer/commitment-task:arbitrum-integrationmusl
ports:
- "$ESPRESSO_COMMITMENT_TASK_PORT:$ESPRESSO_COMMITMENT_TASK_PORT"
command: commitment-task --deploy
Expand Down Expand Up @@ -490,4 +491,4 @@ volumes:
poster-data-c:
config:
postgres-data:
sdk-data:
tokenbridge-data:
2 changes: 1 addition & 1 deletion scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:16-bullseye-slim
WORKDIR /workspace
COPY ./package.json ./yarn.lock ./
RUN yarn
Expand Down
35 changes: 29 additions & 6 deletions scripts/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as crypto from "crypto";
import { runStress } from "./stress";
const path = require("path");

const specialAccounts = 6;
const specialAccounts = 7;

async function writeAccounts() {
for (let i = 0; i < specialAccounts; i++) {
Expand Down Expand Up @@ -44,8 +44,11 @@ export function namedAccount(
if (name == "l3sequencer") {
return specialAccount(4);
}
if (name == "espresso-sequencer")
if (name == "l2owner") {
return specialAccount(5);
}
if (name == "espresso-sequencer")
return specialAccount(6);
if (name.startsWith("user_")) {
return new ethers.Wallet(
ethers.utils.sha256(ethers.utils.toUtf8Bytes(name))
Expand Down Expand Up @@ -84,10 +87,11 @@ export function namedAddress(

export const namedAccountHelpString =
"Valid account names:\n" +
" funnel | sequencer | validator - known keys\n" +
" user_[Alphanumeric] - key will be generated from username\n" +
" threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" +
" key_0x[full private key] - user with specified private key\n" +
" funnel | sequencer | validator | l2owner - known keys used by l2\n" +
" l3owner | l3sequencer - known keys used by l3\n" +
" user_[Alphanumeric] - key will be generated from username\n" +
" threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" +
" key_0x[full private key] - user with specified private key\n" +
"\n" +
"Valid addresses: any account name, or\n" +
" address_0x[full eth address]\n" +
Expand All @@ -97,6 +101,10 @@ async function handlePrintAddress(argv: any, threadId: number) {
console.log(namedAddress(argv.account, threadId));
}

async function handlePrintPrivateKey(argv: any, threadId: number) {
console.log(namedAccount(argv.account, threadId).privateKey);
}

export const printAddressCommand = {
command: "print-address",
describe: "prints the requested address",
Expand All @@ -112,6 +120,21 @@ export const printAddressCommand = {
},
};

export const printPrivateKeyCommand = {
command: "print-private-key",
describe: "prints the requested private key",
builder: {
account: {
string: true,
describe: "account (see general help)",
default: "funnel",
},
},
handler: async (argv: any) => {
await runStress(argv, handlePrintPrivateKey);
},
}

export const writeAccountsCommand = {
command: "write-accounts",
describe: "writes wallet files",
Expand Down
Loading

0 comments on commit 3fd5f4b

Please sign in to comment.