-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] Visualize diff to upstream v3.1.0 #200
Conversation
Test the winner in e2e test
Fixes compilation on OSX. Not sure why.
llvm 17 -> 16
VID Namespace Validation
* Fix the delayed transactions * Update system_tests/espresso_e2e_test.go Co-authored-by: Mathis <[email protected]> --------- Co-authored-by: Mathis <[email protected]>
* Update espresso-sequencer-go * Support builder-guaranteed tx * Update the error message
* Save digest artifacts into own directory per run Currently it seems that we have too many digests in the folder and I think this breaks the assembly of the multiarch docker image. With this change only digests for the same run are saved in the same directory. * Fail docker image merge on wrong number of digests * Clean digests dir
Clean the log with the log helper
* Add missing dependency * Use renamed variable, fix typo
Pin the golint version in CI
* Fix pebble panic * lint
@@ -185,7 +185,20 @@ func CreateExecutionNode( | |||
if err != nil { | |||
return nil, err | |||
} | |||
txPublisher = sequencer | |||
if config.Sequencer.Espresso { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create EspressoSequencer
in espresso mode.
if err != nil { | ||
return nil, err | ||
} | ||
switchSequencer, err := NewSwitchSequencer(sequencer, espressoSequencer, parentChainReader.Client(), seqConfigFetcher) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the automated escape hatch to restore liveness during HotShot liveness failures.
|
||
// Espresso specific flags | ||
Espresso bool `koanf:"espresso"` | ||
EnableEspressoSovereign bool `koanf:"enable-espresso-sovereign"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the sovereign sequencer mode, where nitro remains the block builder.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## last-upstream-sync #200 +/- ##
=====================================================
Coverage ? 24.44%
=====================================================
Files ? 266
Lines ? 38773
Branches ? 0
=====================================================
Hits ? 9479
Misses ? 27666
Partials ? 1628 |
if err != nil { | ||
return 0, false, nil, err | ||
} | ||
if oldJst.BlockMerkleJustification == nil && newJst.BlockMerkleJustification != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ImJeremyHe @nomaxg why do we need to have this extra logic to check for duplicates? We should probably add more explicit comments to the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that there should be more comments.
That is because that batch poster should wait for the justifications from hotshot and fill the messages with them before posting them to L1. This means that actually the batch poster are modifying the existing messages.
For some validators, they receive the l2 messages without any jst first and maintain the l2 blocks. And they also fetch the messages from L1. No matter where the messages are from, they are eventually stored in the transaction streamer
. So, the transaction streamer will check if the these messages from different sources are the same. If not, it will consider a reorg happening.
That's why we have to add these code here to get around the misunderstanding of reorg
@@ -1136,7 +1202,310 @@ func (s *TransactionStreamer) executeMessages(ctx context.Context, ignored struc | |||
return s.config().ExecuteMessageLoopDelay | |||
} | |||
|
|||
func (s *TransactionStreamer) PollSubmittedTransactionForFinality(ctx context.Context) time.Duration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining changes in this file are for the sovereign sequencer mode. They handle the submission of L2 blocks to the Espresso Sequencer for notarization.
BlockMerkleComm *espressoTypes.TaggedBase64 | ||
} | ||
|
||
type EspressoBlockJustification struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Justification is used to justify that the L2 blocks are created from the transactions sequenced by the Espresso sequencer, or in other words went through the HotShot consensus.
@@ -288,6 +313,22 @@ func ProduceBlockAdvanced( | |||
return nil, nil, err | |||
} | |||
|
|||
if chainConfig.ArbitrumChainParams.EnableEspresso { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for a feature we called "builder guaranteed transactions". It allows wallets to "tag" their transactions with an Ethereum address of a builder to only allow that builder to include the transaction in a block.
@@ -95,6 +107,8 @@ const ( | |||
L2MessageKind_Heartbeat = 6 // deprecated | |||
L2MessageKind_SignedCompressedTx = 7 | |||
// 8 is reserved for BLS signed batch | |||
L2MessageKind_EspressoSequencedTx = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the espresso sequencer as sequencer for the L2 (this is deprecated, in favor of the sovereign sequencer).
@@ -95,6 +107,8 @@ const ( | |||
L2MessageKind_Heartbeat = 6 // deprecated | |||
L2MessageKind_SignedCompressedTx = 7 | |||
// 8 is reserved for BLS signed batch | |||
L2MessageKind_EspressoSequencedTx = 10 | |||
L2MessageKind_EspressoSovereignTx = 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the Espresso sequencer as notarization layer.
commitment, | ||
) | ||
if jst.Proof != nil { | ||
espressocrypto.VerifyNamespace(chainConfig.ChainID.Uint64(), *jst.Proof, *jst.Header.PayloadCommitment, *jst.Header.NsTable, txs, *jst.VidCommon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call dispatches to the espresso crypto helper to verify the integrity of the Espresso namespace. Currently this checks that the L2 transactions are exactly the ones that were finalized by Espresso consensus.
@@ -0,0 +1,148 @@ | |||
package gethexec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module allows the nitro sequencer running on Espresso to automatically bypass the Espresso sequencer in case of a liveness failure to avoid stalling Nitro.
SendRoot common.Hash | ||
Batch uint64 | ||
PosInBatch uint64 | ||
HotShotHeight uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The block height of hotshot is used to enforce a continuous mapping between Espresso and nitro blocks (barring the Escape hatch being turned on).
@@ -22,4 +23,9 @@ type ValidationInput struct { | |||
DelayedMsg []byte | |||
StartState GoGlobalState | |||
DebugChain bool | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra validation input for validation of Espresso integration functionality.
- The height is used for continuity check of blocks.
- The hotshot commitment is used to verify the integrity of transactions.
- The hotshot liveness is used to validate correct use of the escape hatch.
@@ -286,6 +292,15 @@ impl Hostio { | |||
opcode!(LocalGet, 1); | |||
opcode!(ReadPreImage, PreimageType::Sha2_256); | |||
} | |||
WavmReadHotShotCommitment => { | |||
opcode!(LocalGet, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nomaxg do you know what these opcode
do, and why it's 0, 1 for the commitment and just 0 for the liveness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here defines how the WavmReadHotShotCommitment
should be converted into OpCodes. LocalGet
means getting something from somewhere and putting them to the value_stack
.
Since the ReadHotShotCommitment
opcode requires 2 arguments, so we have to LocalGet
two times. (One pointer for the place where the commitment will be stored, and the other for the hotshot height)
As for the Liveness
, we don't need to store the bool value into the module memory. (I don't quite understand why, but readInboxMessage
stores the messages into the memory and the hotshot commitment seems something similar to the InboxMessage)
@@ -247,6 +279,56 @@ pub unsafe extern "C" fn arbitrator_step_until_host_io( | |||
ptr::null_mut() | |||
} | |||
|
|||
#[no_mangle] | |||
#[cfg(feature = "native")] | |||
pub unsafe extern "C" fn arbitrator_step_until_is_hotshot_live( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nomaxg @ImJeremyHe this function and the one below are exactly the same. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I believe this is a bug. But this function is only used in the espresso_osp_test
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. We should investigate why the test passes despite this bug.
if mach.is_halted() { | ||
return ptr::null_mut(); | ||
} | ||
if mach.next_instruction_is_read_hotshot() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ImJeremyHe @nomaxg feels like this should be next_instruction_is_hotshot_live
* Improve help texts for flags
* Update e2e tests to use Sovereign sequencer Co-authored-by: ImJeremyHe <[email protected]>
I'm closing this PR to prevent it from triggering the already troubled CI. |
This PR is there to visualize the diff between our
integration
branch and thelast-upstream-sync
branch. Currentlylast-upstream-sync
is at tagv3.1.0
.