@aztec/sequencer-client 0.1.0-alpha47 → 0.1.0-alpha48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.tsbuildinfo +1 -1
  2. package/dest/block_builder/solo_block_builder.test.d.ts.map +1 -1
  3. package/dest/block_builder/solo_block_builder.test.js +3 -3
  4. package/dest/global_variable_builder/index.d.ts +1 -0
  5. package/dest/global_variable_builder/index.d.ts.map +1 -1
  6. package/dest/global_variable_builder/index.js +1 -1
  7. package/dest/index.d.ts +2 -0
  8. package/dest/index.d.ts.map +1 -1
  9. package/dest/index.js +4 -1
  10. package/dest/publisher/l1-publisher.d.ts +12 -6
  11. package/dest/publisher/l1-publisher.d.ts.map +1 -1
  12. package/dest/publisher/l1-publisher.js +3 -3
  13. package/dest/publisher/viem-tx-sender.d.ts +3 -3
  14. package/dest/publisher/viem-tx-sender.d.ts.map +1 -1
  15. package/dest/publisher/viem-tx-sender.js +10 -7
  16. package/dest/sequencer/processed_tx.d.ts +13 -0
  17. package/dest/sequencer/processed_tx.d.ts.map +1 -1
  18. package/dest/sequencer/processed_tx.js +1 -1
  19. package/dest/sequencer/public_processor.d.ts +2 -2
  20. package/dest/sequencer/public_processor.d.ts.map +1 -1
  21. package/dest/sequencer/public_processor.js +10 -5
  22. package/dest/sequencer/public_processor.test.js +9 -7
  23. package/dest/sequencer/sequencer.d.ts +2 -2
  24. package/dest/sequencer/sequencer.d.ts.map +1 -1
  25. package/dest/sequencer/sequencer.js +11 -10
  26. package/dest/simulator/index.d.ts +1 -0
  27. package/dest/simulator/index.d.ts.map +1 -1
  28. package/dest/simulator/index.js +2 -2
  29. package/package.json +10 -10
  30. package/src/block_builder/solo_block_builder.test.ts +2 -1
  31. package/src/global_variable_builder/index.ts +1 -0
  32. package/src/index.ts +4 -0
  33. package/src/publisher/l1-publisher.ts +15 -13
  34. package/src/publisher/viem-tx-sender.ts +10 -7
  35. package/src/sequencer/processed_tx.ts +14 -0
  36. package/src/sequencer/public_processor.test.ts +16 -7
  37. package/src/sequencer/public_processor.ts +11 -7
  38. package/src/sequencer/sequencer.ts +10 -20
  39. package/src/simulator/index.ts +2 -0
@@ -3,15 +3,7 @@ import { Fr } from '@aztec/foundation/fields';
3
3
  import { createDebugLogger } from '@aztec/foundation/log';
4
4
  import { RunningPromise } from '@aztec/foundation/running-promise';
5
5
  import { P2P } from '@aztec/p2p';
6
- import {
7
- ContractData,
8
- ContractDataAndBytecode,
9
- L1ToL2MessageSource,
10
- L2Block,
11
- L2BlockSource,
12
- MerkleTreeId,
13
- Tx,
14
- } from '@aztec/types';
6
+ import { L1ToL2MessageSource, L2Block, L2BlockSource, MerkleTreeId, Tx } from '@aztec/types';
15
7
  import { WorldStateStatus, WorldStateSynchroniser } from '@aztec/world-state';
16
8
 
17
9
  import times from 'lodash.times';
@@ -149,8 +141,9 @@ export class Sequencer {
149
141
  const processor = await this.publicProcessorFactory.create(prevGlobalVariables, newGlobalVariables);
150
142
  const [processedTxs, failedTxs] = await processor.process(validTxs);
151
143
  if (failedTxs.length > 0) {
152
- this.log(`Dropping failed txs ${(await Tx.getHashes(failedTxs)).join(', ')}`);
153
- await this.p2pClient.deleteTxs(await Tx.getHashes(failedTxs));
144
+ const failedTxData = failedTxs.map(fail => fail.tx);
145
+ this.log(`Dropping failed txs ${(await Tx.getHashes(failedTxData)).join(', ')}`);
146
+ await this.p2pClient.deleteTxs(await Tx.getHashes(failedTxData));
154
147
  }
155
148
 
156
149
  if (processedTxs.length === 0) {
@@ -170,7 +163,7 @@ export class Sequencer {
170
163
  const block = await this.buildBlock(processedTxs, l1ToL2Messages, emptyTx, newGlobalVariables);
171
164
  this.log(`Assembled block ${block.number}`);
172
165
 
173
- await this.publishContractDataAndBytecode(validTxs, block);
166
+ await this.publishExtendedContractData(validTxs, block);
174
167
 
175
168
  await this.publishL2Block(block);
176
169
  this.log.info(`Submitted rollup block ${block.number} with ${processedTxs.length} transactions`);
@@ -182,28 +175,25 @@ export class Sequencer {
182
175
  }
183
176
 
184
177
  /**
185
- * Gets new contract data and bytecode from the txs and publishes it on chain.
178
+ * Gets new extended contract data from the txs and publishes it on chain.
186
179
  * @param validTxs - The set of real transactions being published as part of the block.
187
180
  * @param block - The L2Block to be published.
188
181
  */
189
- protected async publishContractDataAndBytecode(validTxs: Tx[], block: L2Block) {
182
+ protected async publishExtendedContractData(validTxs: Tx[], block: L2Block) {
190
183
  // Publishes contract data for txs to the network and awaits the tx to be mined
191
184
  this.state = SequencerState.PUBLISHING_CONTRACT_DATA;
192
185
  const newContractData = validTxs
193
186
  .map(tx => {
194
187
  // Currently can only have 1 new contract per tx
195
188
  const newContract = tx.data?.end.newContracts[0];
196
- if (newContract && tx.newContractPublicFunctions?.length) {
197
- return new ContractDataAndBytecode(
198
- new ContractData(newContract.contractAddress, newContract.portalContractAddress),
199
- tx.newContractPublicFunctions,
200
- );
189
+ if (newContract) {
190
+ return tx.newContracts[0];
201
191
  }
202
192
  })
203
193
  .filter((cd): cd is Exclude<typeof cd, undefined> => cd !== undefined);
204
194
 
205
195
  const blockHash = block.getCalldataHash();
206
- this.log(`Publishing contract data and bytecode with block hash ${blockHash.toString('hex')}`);
196
+ this.log(`Publishing extended contract data with block hash ${blockHash.toString('hex')}`);
207
197
 
208
198
  const publishedContractData = await this.publisher.processNewContractData(block.number, blockHash, newContractData);
209
199
  if (publishedContractData) {
@@ -8,6 +8,8 @@ import {
8
8
  RootRollupPublicInputs,
9
9
  } from '@aztec/circuits.js';
10
10
 
11
+ export { getPublicExecutor } from './public_executor.js';
12
+
11
13
  /**
12
14
  * Circuit simulator for the rollup circuits.
13
15
  */