Skip to content

Commit

Permalink
stashing
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Dec 10, 2024
1 parent b72e332 commit 267505e
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 26 deletions.
300 changes: 299 additions & 1 deletion contracts/generated/ManagementContract/ManagementContract.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions go/common/l1_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ type ProcessedL1Data struct {

// L1TxData represents an L1 transaction that are relevant to us
type L1TxData struct {
Transaction *types.Transaction
Receipt *types.Receipt
Blobs []*kzg4844.Blob // Only populated for blob transactions
SequencerEnclaveID *EnclaveID // Only populated when a new enclave is added as a sequencer
Transaction *types.Transaction
Receipt *types.Receipt
Blobs []*kzg4844.Blob // Only populated for blob transactions
//SequencerEnclaveID *EnclaveID // Only populated when a new enclave is added as a sequencer
CrossChainMessages *CrossChainMessages // Only populated for xchain messages
ValueTransfers *ValueTransferEvents // Only populated for xchain transfers
Proof []byte // Some merkle proof TBC
Expand Down
1 change: 1 addition & 0 deletions go/enclave/crosschain/block_message_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (m *blockMessageExtractor) StoreCrossChainValueTransfers(ctx context.Contex
// collect all value transfer events from processed data
var transfers common.ValueTransferEvents
for _, txData := range processedData.GetEvents(common.CrossChainValueTranserTx) {
println("VALUE TRANSFER EVENT FOUND")
if txData.ValueTransfers != nil {
transfers = append(transfers, *txData.ValueTransfers...)
}
Expand Down
6 changes: 4 additions & 2 deletions go/enclave/enclave_admin_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,11 @@ func (e *enclaveAdminService) ingestL1Block(ctx context.Context, processed *comm
}

sequencerAddedTxs := processed.GetEvents(common.SequencerAddedTx)
for _, tx := range sequencerAddedTxs {
println("Sequencer ADDED: ", tx.Transaction.Hash().Hex())
if len(sequencerAddedTxs) > 0 {
println("Sequencer ADDED tx hash: ", sequencerAddedTxs[0].Transaction.Hash().Hex())
}
//for _, tx := range sequencerAddedTxs {
//}
//TODO call AddSequencer if event present

if ingestion.IsFork() {
Expand Down
6 changes: 1 addition & 5 deletions go/host/l1/blockrepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,7 @@ func (r *Repository) ExtractTenTransactions(block *common.L1Block) (*common.Proc
}

if len(txLogs.sequencerLogs) > 0 {
println("SEQUENCER ENCLAVE ADDED ")
//if enclaveIDs, err := crosschain.ConvertLogsToSequencerEnclaves(txLogs.sequencerLogs, crosschain.SequencerEnclaveGrantedEventName, crosschain.MgmtContractABI); err == nil {
// txData.SequencerEnclaveIDs = enclaveIDs
processed.AddEvent(common.SequencerAddedTx, txData)
//}
processed.AddEvent(common.SequencerAddedTx, txData)
}

if len(txLogs.secretRequestLogs) > 0 {
Expand Down
28 changes: 14 additions & 14 deletions integration/simulation/simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,19 @@ func (s *Simulation) bridgeFundingToTen() {

time.Sleep(15 * time.Second)
// todo - fix the wait group, for whatever reason it does not find a receipt...
//wg := sync.WaitGroup{}
//for _, tx := range transactions {
// wg.Add(1)
// transaction := tx
// go func() {
// defer wg.Done()
// err := testcommon.AwaitReceiptEth(s.ctx, s.RPCHandles.RndEthClient(), transaction.Hash(), 20*time.Second)
// if err != nil {
// panic(err)
// }
// }()
//}
//wg.Wait()
/*wg := sync.WaitGroup{}
for _, tx := range transactions {
wg.Add(1)
transaction := tx
go func() {
defer wg.Done()
err := testcommon.AwaitReceiptEth(s.ctx, s.RPCHandles.RndEthClient(), transaction.Hash(), 20*time.Second)
if err != nil {
panic(err)
}
}()
}
wg.Wait()*/
}

// We subscribe to logs on every client for every wallet.
Expand Down Expand Up @@ -332,7 +332,7 @@ func (s *Simulation) deployTenZen() {
return fmt.Errorf("waiting for positive balance")
}
return nil
}, retry.NewTimeoutStrategy(60*time.Second, 2*time.Second))
}, retry.NewTimeoutStrategy(1*time.Minute, 2*time.Second))
if err != nil {
panic(fmt.Errorf("failed to get positive balance after timeout: %w", err))
}
Expand Down

0 comments on commit 267505e

Please sign in to comment.