Skip to content

Fix op-batcher-tee 's PCR0 registration#227

Closed
dailinsubjam wants to merge 14 commits intocelo-integration-rebase-13.2from
sishan/batcher-tee-fix
Closed

Fix op-batcher-tee 's PCR0 registration#227
dailinsubjam wants to merge 14 commits intocelo-integration-rebase-13.2from
sishan/batcher-tee-fix

Conversation

@dailinsubjam
Copy link
Copy Markdown

@dailinsubjam dailinsubjam commented Sep 4, 2025

Closes https://app.asana.com/1/1208976916964769/project/1209393353274209/task/1211215435859948?focus=true
https://app.asana.com/1/1208976916964769/project/1209392461754458/task/1211248432980276?focus=true

This PR:

Fix this error when running op-batcher-tee in current devnet INFO  enclave         > t=2025-09-02T23:12:21+0000 lvl=warn msg="Failed to create a transaction, will retry" service=batcher err="failed to estimate gas: execution reverted, reason: 0x" by building enclave image once in consistent environment, reuse everywhere.

This PR does not:

Key places to review:

All changes.
I wrote a script to build PCR0 outside of Docker so it stays persistent. This requires deleting all cached Docker layers. Let me know if you have a cleaner or better solution.

How to test this PR:

(you can also take a look at Readme changes)

docker system prune -f
cd .. && rm -f espresso/shared/*
cd op-batcher && just op-batcher && cd ../espresso
docker compose stop op-batcher-tee
docker compose rm -f op-batcher-tee # make sure any cached PCR0 is deleted
./scripts/build-enclave-image.sh # to build persistent PCR0 outside of docker
COMPOSE_PROFILES=tee docker compose up op-batcher-tee -d

@dailinsubjam dailinsubjam marked this pull request as draft September 4, 2025 16:29
@dailinsubjam dailinsubjam marked this pull request as ready for review September 5, 2025 16:23
docker compose stop op-batcher-tee
docker compose rm -f op-batcher-tee
./scripts/build-enclave-image.sh
echo "✅ op-batcher-enclave image prepared"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see this message when running the script, nor the messages below. The last log is Building enclave image WITHOUT args for consistent PCR0....

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Seems this is due to not building enclave-tools, updated in bd78533

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

nitro-cli is also needed here, however it's only accessible on x86-64 linux, upd in a08c375.

COMPOSE_PROFILES=tee docker compose build
echo "✅ Docker compose build complete"

# Check for AWS Nitro Enclave support
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we have this check earlier, since it's step 5 that usually doesn't succeed?

@dailinsubjam
Copy link
Copy Markdown
Author

Close it in favor of #232 and https://app.asana.com/1/1208976916964769/project/1209976130071762/task/1211414707436431. It turns out this is not a PCR0 registration issue. And could be resolved by waiting for 45min at the beginning. Will investigate and try to improve in the new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants