feat: txe state machine#13836
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
fcc8540 to
8e927b7
Compare
8e927b7 to
1388af7
Compare
1388af7 to
790c690
Compare
790c690 to
1e1a517
Compare
3892f4e to
4b513b3
Compare
| let args = [test_account.keys.ivpk_m.inner.x, test_account.keys.ivpk_m.inner.y]; | ||
| let _ = context.call_private_function(address, selector, args); | ||
|
|
||
| cheatcodes::advance_blocks_by(1); |
There was a problem hiding this comment.
Sneaking this fix in as it's better after and is not required above.
| ? Math.min(limit, Math.max((await this.store.getProvenL2BlockNumber()) - from + 1, 0)) | ||
| : limit; | ||
| return limitWithProven === 0 ? [] : await this.store.getBlocks(from, limitWithProven); | ||
| return limitWithProven === 0 ? [] : await this.store.getPublishedBlocks(from, limitWithProven); |
There was a problem hiding this comment.
This renaming is done to let txe archiver extend the archiver data store due to types. I feel like it's okay because the naming better reflects what it actually does now.
| * store would need to include otherwise while exposing fewer functions and logic directly to the archiver. | ||
| */ | ||
| class ArchiverStoreHelper | ||
| export class ArchiverStoreHelper |
There was a problem hiding this comment.
Exported to allow imported from txe
|
|
||
| getChainId(): Promise<Fr> { | ||
| return Promise.resolve(this.node.getChainId().then(id => new Fr(id))); | ||
| return Promise.resolve(new Fr(this.CHAIN_ID)); |
There was a problem hiding this comment.
Sneaking this fix in
c1e8135 to
7e35402
Compare
7e35402 to
9516fc1
Compare
| "@aztec/archiver": "workspace:^", | ||
| "@aztec/aztec-node": "workspace:^", | ||
| "@aztec/aztec.js": "workspace:^", | ||
| "@aztec/bb-prover": "workspace:^", |
There was a problem hiding this comment.
Good eye, I think though I'm importing import { TestCircuitVerifier } from '@aztec/bb-prover/test'; when creating the node, so unfortunately yes :/
Thunkar
left a comment
There was a problem hiding this comment.
LGTM, but I would check with someone from alpha-team for the archiver refactor!
Thanks, good idea ! Have requested a review from @alexghr 🙏 |
0a2a966 to
62877a7
Compare
62877a7 to
5afa42c
Compare
| import { convertToMultiaddr, createLibP2PPeerIdFromPrivateKey } from '../util.js'; | ||
| import { setAztecEnrKey } from '../versioning.js'; | ||
|
|
||
| export { ENR }; |
There was a problem hiding this comment.
Exported this so downstream I have access to it without having to install ENR
|
|
||
| const stateMachine = await TXEStateMachine.create(store); | ||
| const syncDataProvider = stateMachine.syncDataProvider; | ||
| const nativeWorldStateService = stateMachine.synchronizer.nativeWorldStateService; |
There was a problem hiding this comment.
It's done this way to maintain backwards compatibility / minimize changes needed in this PR

This PR removes the TXe node with an implementation of a TXe state machine which combines an aztec node, and a custom archiver / synchronizer.
Note: Because of the extension of
ArchiverStoreHelper, there was a clash ofgetBlocks, in one interface it was expected to receiveL2Blocks, and in the otherPublishedBlocks. To solve this, I have renamedgetBlockson theArchiverStoreHelpertogetPublishedBlocks. But doing so I also did the same renaming on the ArchiverDataStore because it seems to better match the signature anyways.