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

[devnet] Running create-account on fresh aztec node throws error #7537

Closed
spalladino opened this issue Jul 19, 2024 · 5 comments · Fixed by #7928
Closed

[devnet] Running create-account on fresh aztec node throws error #7537

spalladino opened this issue Jul 19, 2024 · 5 comments · Fixed by #7928
Labels
T-bug Type: Bug. Something is broken.

Comments

@spalladino
Copy link
Collaborator

Setting up a fresh node with:

ETHEREUM_HOST='http://localhost:8545' DEPLOY_AZTEC_CONTRACTS=1 SEQ_PUBLISHER_PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d yarn aztec start --node --sequencer --prover --archiver --pxe

And then running:

yarn aztec create-account

Triggers the error:

aztec:simulator:acvm [ERROR] Error in oracle callback storageRead: Invalid block number to get world state for: 0 +0ms

Running another command like bootstrap that advances the chain a bit fixes this.

@spalladino spalladino added the T-bug Type: Bug. Something is broken. label Jul 19, 2024
@github-project-automation github-project-automation bot moved this to Todo in A3 Jul 19, 2024
spalladino added a commit that referenced this issue Jul 25, 2024
Adds a new package `@aztec/bot` that sends txs at regular intervals. The
bot idempotently deploys a schnorr account contract and a token contract
and mints funds to its own account, and sends a tx with a configurable
number of private and public transfers.

Bot can be started via `aztec start --bot`, either connected to a remote
pxe or using a local one, and optionally run within a node. The bot
exposes an http control interface when started, so it can be managed
like:

```bash
curl -XPOST -d'{"method": "bot_getConfig"}' http://localhost:8090
curl -XPOST -d'{"method": "bot_update", "params": [{"txIntervalSeconds": 20}]}' http://localhost:8090
curl -XPOST -d'{"method": "bot_stop"}' http://localhost:8090
```

A known issue is that running the bot within a non-sandbox node fails
with #7537.

Fixes #7562
@koxu1996
Copy link

koxu1996 commented Aug 6, 2024

I am getting the same error when trying to bootstrap-network:

  aztec:cli [ERROR] Error in command execution +0ms
  aztec:cli [ERROR] Error: (JSON-RPC PROPAGATED) Invalid block number to get world state for: 0
Error: (JSON-RPC PROPAGATED) Invalid block number to get world state for: 0
    at axiosFetch (file:///usr/src/yarn-project/cli/dest/client.js:36:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async request (file:///usr/src/yarn-project/foundation/dest/json-rpc/client/json_rpc_client.js:88:21)
    at async DeployAccountMethod.prove (file:///usr/src/yarn-project/aztec.js/dest/contract/base_contract_interaction.js:21:19)
    at async file:///usr/src/yarn-project/aztec.js/dest/contract/base_contract_interaction.js:35:36
    at async DeployAccountSentTx.waitForReceipt (file:///usr/src/yarn-project/aztec.js/dest/contract/sent_tx.js:86:24)
    at async DeployAccountSentTx.wait (file:///usr/src/yarn-project/aztec.js/dest/contract/sent_tx.js:47:25)
    at async DeployAccountSentTx.wait (file:///usr/src/yarn-project/aztec.js/dest/account_manager/deploy_account_sent_tx.js:26:25)
    at async DeployAccountSentTx.getWallet (file:///usr/src/yarn-project/aztec.js/dest/account_manager/deploy_account_sent_tx.js:17:25)
    at async bootstrapDevnet (file:///usr/src/yarn-project/cli/dest/cmds/devnet/bootstrap_devnet.js:13:20) +0ms

Is that expected? Version: 0.47.1.

@spalladino
Copy link
Collaborator Author

Hey @koxu1996 this is still an issue, I believe it's related to an off-by-one error in how we handle the first block number. You can work around it by having the chain move forward with other commands - I believe that deploy-protocol-contracts works fine, and it's something you'll need to run anyway to get everything going.

@koxu1996
Copy link

koxu1996 commented Aug 7, 2024

Since node cannot be started without protocol contracts - Error: Deployed L1 contract addresses are required to start the service - I used export DEPLOY_AZTEC_CONTRACTS=true to deploy them on start:

$ start --node --archiver --sequencer --prover --pxe
  aztec:sandbox [INFO] Deployed Registry at 0xb0d4afd8879ed9f52b28595d31b441d079b2ca07 +0ms
  aztec:sandbox [INFO] Deployed AvailabilityOracle at 0x162a433068f51e18b7d13932f27e66a3f99e6890 +13ms
  aztec:sandbox [INFO] Deployed Gas Token at 0x922d6956c99e12dfeb3224dea977d0939758a1fe +6ms
  aztec:sandbox [INFO] Deployed Rollup at 0x5081a39b8a5f0e35a8d959395a630b68b74dd30f +13ms
  aztec:sandbox [INFO] Inbox available at 0x87d368640db91a995032cedcc5a0016d4bb514ed +2ms
  aztec:sandbox [INFO] Outbox available at 0xe47df972d794ef4bc589f28de30cb7cb92897a91 +0ms
  aztec:sandbox [INFO] Deployed Gas Portal at 0xdbc43ba45381e02825b14322cddd15ec4b3164e6 +12ms
  aztec:sandbox [INFO] Initialized Gas Portal at 0xdbc43ba45381e02825b14322cddd15ec4b3164e6 to bridge between L1 0x922d6956c99e12dfeb3
224dea977d0939758a1fe to L2 0x06fc7badd50bb8ee32439b52e8874b5a16ddd2aa1d5647ec46b2a0f51356f889 +4s
  aztec:sandbox [INFO] Funded rollup contract with gas tokens +23ms
...
...
  aztec:pxe_service [INFO] Added contract ContractClassRegisterer at 0x1da1c95bfa44d2d94cda61564e0b28a3515f0b2ad4bd8d30d86572f02e2fba00 +0ms
  aztec:pxe_service [INFO] Added contract ContractInstanceDeployer at 0x2b231c13768709b1ba51c1f86275b47e38dfac16e3d7f242cb578d92a4e2d934 +7ms
  aztec:pxe_service [INFO] Added contract MultiCallEntrypoint at 0x05425591680496cbc66f87c6e2a7669f253c205e4487e2046e72a6d8a74aa73b +8ms
  aztec:pxe_service [INFO] Added contract GasToken at 0x06fc7badd50bb8ee32439b52e8874b5a16ddd2aa1d5647ec46b2a0f51356f889 +8ms
  aztec:pxe_service [INFO] Added contract KeyRegistry at 0x04c2d010f88e8c238882fbbcbce5c81fdc1dc8ece85e8dbf3f602b4d81ec0351 +8ms
  aztec:pxe_service [INFO] Added contract AuthRegistry at 0x27ffa4fb3da8a80b6365315f9798c887474854c71c0720e1c5236861288ce147 +8ms
  aztec:pxe_synchronizer [INFO] Initial sync complete +0ms
  aztec:pxe_service [INFO] Started PXE connected to chain 31337 version 1 +36ms
Aztec Server listening on port 8080

After that L2 block height is still 0, which cause above mentioned issue.

Surprisingly, running additional deploy-protocol-contracts advances L2 blocks and make everything working 😌. Thanks @spalladino!

NOTE: I am surprised to see sandbox in logs, and I think DEPLOY_AZTEC_CONTRACTS should have consistent behavior with deploy-protocol-contracts command.

@spalladino
Copy link
Collaborator Author

This is, as usual, a poor choice of names: DEPLOY_AZTEC_CONTRACTS instructs the aztec node to deploy Aztec rollup contracts on L1, whereas deploy-protocol-contracts deploys a set of required contracts (think precompiles but not really) on L2. So they do completely different things!

@koxu1996
Copy link

koxu1996 commented Aug 7, 2024

Ah, okay. Thanks for explanation!

PhilWindle pushed a commit that referenced this issue Aug 13, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Aug 13, 2024
spalladino added a commit that referenced this issue Aug 13, 2024
- Adds much-needed comments
- Loads `PROVER_REAL_PROOFS`, `PROVER_TEST_DELAY_MS`, and
`ASSUME_PROVEN_UNTIL_BLOCK_NUMBER` from env
- Increases tx interval
- ~Splits up bot and pxe~
- ~Adds a bootstrap step to work around
#7537
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: Bug. Something is broken.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants