@@ -156,7 +156,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
156156 // True if the SequencerInbox is delay bufferable
157157 bool public immutable isDelayBufferable;
158158
159- IEspressoTEEVerifier public espressoTEEVerifier ;
159+ KeyManager public timeboostKeyManager ;
160160
161161 constructor (
162162 uint256 _maxDataSize ,
@@ -221,7 +221,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
221221 ISequencerInbox.MaxTimeVariation calldata maxTimeVariation_ ,
222222 BufferConfig memory bufferConfig_ ,
223223 IFeeTokenPricer feeTokenPricer_ ,
224- address _espressoTEEVerifier
224+ address _timeboostKeyManager
225225 ) external onlyDelegated {
226226 if (bridge != IBridge (address (0 ))) revert AlreadyInit ();
227227 if (bridge_ == IBridge (address (0 ))) revert HadZeroInit ();
@@ -252,7 +252,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
252252
253253 feeTokenPricer = feeTokenPricer_;
254254
255- espressoTEEVerifier = IEspressoTEEVerifier (_espressoTEEVerifier );
255+ timeboostKeyManager = KeyManager (_timeboostKeyManager );
256256 }
257257
258258 /// @notice Allows the rollup owner to sync the rollup address
@@ -435,7 +435,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
435435 IGasRefunder gasRefunder ,
436436 uint256 prevMessageCount ,
437437 uint256 newMessageCount ,
438- bytes memory espressoMetadata
438+ bytes memory signatures
439439 ) external refundsGas (gasRefunder, IReader4844 (address (0 ))) {
440440 if (! CallerChecker.isCallerCodelessOrigin ()) revert NotCodelessOrigin ();
441441 if (! isBatchPoster[msg .sender ]) revert NotBatchPoster ();
@@ -445,11 +445,6 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
445445 // Question for Espresso Team
446446 // Should we check the quote here?
447447
448- (uint256 hotshotHeight , bytes memory signature , IEspressoTEEVerifier.TeeType teeType ) = abi.decode (
449- espressoMetadata,
450- (uint256 , bytes , IEspressoTEEVerifier.TeeType)
451- );
452-
453448 // take keccak2256 hash of all the function arguments
454449 // along with the hotshot height
455450 bytes32 reportDataHash = keccak256 (
@@ -459,16 +454,17 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
459454 afterDelayedMessagesRead,
460455 address (gasRefunder),
461456 prevMessageCount,
462- newMessageCount,
463- hotshotHeight
457+ newMessageCount
464458 )
465459 );
466460 // verify the the reportDataHash was signed by the a registered ephemeral key
467461 // generated inside a registered TEE
468- espressoTEEVerifier.verify (signature, reportDataHash, teeType);
462+ if (! timeboostKeyManager.verifyBatchSignatures (reportDataHash, signatures)) {
463+ revert ("invalid signatures " );
464+ }
469465 // signature from a registered ephemeral key generated inside TEE
470466 // was verified over the batch data hash
471- emit TEESignatureVerified (sequenceNumber, hotshotHeight );
467+ emit TEESignatureVerified (sequenceNumber, newMessageCount );
472468
473469 addSequencerL2BatchFromCalldataImpl (
474470 sequenceNumber,
@@ -498,19 +494,14 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
498494 IGasRefunder gasRefunder ,
499495 uint256 prevMessageCount ,
500496 uint256 newMessageCount ,
501- bytes memory espressoMetadata
497+ bytes memory signatures
502498 ) external refundsGas (gasRefunder, reader4844) {
503499 if (! isBatchPoster[msg .sender ]) revert NotBatchPoster ();
504500 if (isDelayProofRequired (afterDelayedMessagesRead))
505501 revert DelayProofRequired ();
506502
507503 bytes32 [] memory dataHashes = reader4844.getDataHashes ();
508504 if (dataHashes.length == 0 ) revert MissingDataHashes ();
509-
510- (uint256 hotshotHeight , bytes memory signature , IEspressoTEEVerifier.TeeType teeType ) = abi.decode (
511- espressoMetadata,
512- (uint256 , bytes , IEspressoTEEVerifier.TeeType)
513- );
514505 // take keccak2256 hash of all the function arguments and encode packed blob hashes
515506 // except the quote
516507 bytes32 reportDataHash = keccak256 (
@@ -520,13 +511,14 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
520511 address (gasRefunder),
521512 prevMessageCount,
522513 newMessageCount,
523- abi.encode (dataHashes),
524- hotshotHeight
514+ abi.encode (dataHashes)
525515 )
526516 );
527517 // verify the quote for the batch poster running in the TEE
528- espressoTEEVerifier.verify (signature, reportDataHash, teeType);
529- emit TEESignatureVerified (sequenceNumber, hotshotHeight);
518+ if (! timeboostKeyManager.verifyBatchSignatures (reportDataHash, signatures)) {
519+ revert ("invalid signatures " );
520+ }
521+ emit TEESignatureVerified (sequenceNumber, newMessageCount);
530522 addSequencerL2BatchFromBlobsImpl (
531523 sequenceNumber,
532524 afterDelayedMessagesRead,
@@ -713,7 +705,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
713705 * @param gasRefunder - the gas refunder contract
714706 * @param prevMessageCount - the number of messages in the previous batch
715707 * @param newMessageCount - the number of messages in the new batch
716- * @param espressoMetadata - the signature, the hotshot height, and TeeType
708+ * @param signatures - the signature, the hotshot height, and TeeType
717709 */
718710 function addSequencerL2Batch (
719711 uint256 sequenceNumber ,
@@ -722,7 +714,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
722714 IGasRefunder gasRefunder ,
723715 uint256 prevMessageCount ,
724716 uint256 newMessageCount ,
725- bytes memory espressoMetadata
717+ bytes memory signatures
726718 ) external override refundsGas (gasRefunder, IReader4844 (address (0 ))) {
727719 if (! isBatchPoster[msg .sender ] && msg .sender != address (rollup))
728720 revert NotBatchPoster ();
@@ -735,10 +727,6 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
735727 // Only check the attestation quote if the batch has been posted by the
736728 // batch poster
737729 if (isBatchPoster[msg .sender ]) {
738- (uint256 hotshotHeight , bytes memory signature , IEspressoTEEVerifier.TeeType teeType ) = abi.decode (
739- espressoMetadata,
740- (uint256 , bytes , IEspressoTEEVerifier.TeeType)
741- );
742730 // take keccak2256 hash of all the function arguments
743731 // along with the hotshot height
744732 bytes32 reportDataHash = keccak256 (
@@ -748,15 +736,16 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
748736 afterDelayedMessagesRead,
749737 address (gasRefunder),
750738 prevMessageCount,
751- newMessageCount,
752- hotshotHeight
739+ newMessageCount
753740 )
754741 );
755742
756- espressoTEEVerifier.verify (signature, reportDataHash, teeType);
743+ if (! timeboostKeyManager.verifyBatchSignatures (reportDataHash, signatures)) {
744+ revert ("invalid signatures " );
745+ }
757746 // signature from a registered ephemeral key generated inside a registered TEE
758747 // was verified over the batch data hash
759- emit TEESignatureVerified (sequenceNumber, hotshotHeight );
748+ emit TEESignatureVerified (sequenceNumber, newMessageCount );
760749 }
761750
762751 addSequencerL2BatchFromCalldataImpl (
@@ -1192,10 +1181,10 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
11921181 emit BufferConfigSet (bufferConfig_);
11931182 }
11941183
1195- function setEspressoTEEVerifier (
1196- address _espressoTEEVerifier
1184+ function setTimeboostKeyManager (
1185+ address _timeboostKeyManager
11971186 ) external onlyRollupOwner {
1198- espressoTEEVerifier = IEspressoTEEVerifier (_espressoTEEVerifier );
1187+ timeboostKeyManager = KeyManager (_timeboostKeyManager );
11991188 emit OwnerFunctionCalled (6 );
12001189 }
12011190
0 commit comments