-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify sequencer and l1 communication (#7989)
Fixes #7821. Looking to combine some of the components where there are interfaces that don't really seem to be useful as there would likely be only one implementation. When makes sense, I have joined the "wrapper" and the thing it wrapped because extra wrapping is just confusing. Starting with changing the global variables builder, since that was low hanging. When looking at the `viem-tx-sender` it is more tedious as the tests are heavily abusing that had two separate components. Getting rid of the `gasEstimate` steps as viem seems to perform that estimate step if no gas amount is provided, so might as well make it less verbose, https://viem.sh/docs/contract/writeContract#gas-optional. - Removes the `viem-reader` - Removes the `viem-tx-sender` - Removes the `receiver` - Alter the `GlobalVariableBuilder` to directly read values - Alter the `L1Publisher` to interact directly with the rollup and availability oracle. - Updates the tests
- Loading branch information
Showing
13 changed files
with
405 additions
and
622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
yarn-project/sequencer-client/src/global_variable_builder/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
import { type L1ReaderConfig } from '@aztec/ethereum'; | ||
|
||
import { type GlobalVariableBuilder, SimpleTestGlobalVariableBuilder } from './global_builder.js'; | ||
import { ViemReader } from './viem-reader.js'; | ||
|
||
export { SimpleTestGlobalVariableBuilder as SimpleGlobalVariableBuilder } from './global_builder.js'; | ||
export { GlobalVariableBuilder } from './global_builder.js'; | ||
|
||
/** | ||
* Returns a new instance of the global variable builder. | ||
* @param config - Configuration to initialize the builder. | ||
* @returns A new instance of the global variable builder. | ||
*/ | ||
export function getGlobalVariableBuilder(config: L1ReaderConfig): GlobalVariableBuilder { | ||
return new SimpleTestGlobalVariableBuilder(new ViemReader(config)); | ||
} |
64 changes: 0 additions & 64 deletions
64
yarn-project/sequencer-client/src/global_variable_builder/viem-reader.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
import { type TelemetryClient } from '@aztec/telemetry-client'; | ||
|
||
import { type PublisherConfig, type TxSenderConfig } from './config.js'; | ||
import { L1Publisher } from './l1-publisher.js'; | ||
import { ViemTxSender } from './viem-tx-sender.js'; | ||
|
||
export { L1Publisher } from './l1-publisher.js'; | ||
export * from './config.js'; | ||
|
||
/** | ||
* Returns a new instance of the L1Publisher. | ||
* @param config - Configuration to initialize the new instance. | ||
*/ | ||
export function getL1Publisher(config: PublisherConfig & TxSenderConfig, client: TelemetryClient): L1Publisher { | ||
return new L1Publisher(new ViemTxSender(config), client, config); | ||
} |
Oops, something went wrong.