diff --git a/go/enclave/crosschain/common.go b/go/enclave/crosschain/common.go index 3e51f8ba48..230533faa9 100644 --- a/go/enclave/crosschain/common.go +++ b/go/enclave/crosschain/common.go @@ -24,22 +24,17 @@ import ( ) var ( - MessageBusABI, _ = abi.JSON(strings.NewReader(MessageBus.MessageBusMetaData.ABI)) - MgmtContractABI, _ = abi.JSON(strings.NewReader(ManagementContract.ManagementContractMetaData.ABI)) - CrossChainEventName = "LogMessagePublished" - CrossChainEventID = MessageBusABI.Events[CrossChainEventName].ID - ValueTransferEventName = "ValueTransfer" - ValueTransferEventID = MessageBusABI.Events["ValueTransfer"].ID - SequencerEnclaveGrantedEventName = "SequencerEnclaveGranted" - SequencerEnclaveGrantedEventID = MgmtContractABI.Events["SequencerEnclaveGranted"].ID - NetworkSecretRequestedName = "NetworkSecretRequested" - NetworkSecretRequestedID = MgmtContractABI.Events["NetworkSecretRequested"].ID - NetworkSecretRespondedName = "NetworkSecretResponded" - NetworkSecretRespondedID = MgmtContractABI.Events["NetworkSecretResponded"].ID - RollupAddedName = "RollupAdded" - RollupAddedID = MgmtContractABI.Events["RollupAdded"].ID - ImportantContractAddressUpdatedName = "ImportantContractAddressUpdated" - ImportantContractAddressUpdatedID = MgmtContractABI.Events["ImportantContractAddressUpdated"].ID + MessageBusABI, _ = abi.JSON(strings.NewReader(MessageBus.MessageBusMetaData.ABI)) + MgmtContractABI, _ = abi.JSON(strings.NewReader(ManagementContract.ManagementContractMetaData.ABI)) + CrossChainEventName = "LogMessagePublished" + CrossChainEventID = MessageBusABI.Events[CrossChainEventName].ID + ValueTransferEventName = "ValueTransfer" + ValueTransferEventID = MessageBusABI.Events["ValueTransfer"].ID + SequencerEnclaveGrantedEventID = MgmtContractABI.Events["SequencerEnclaveGranted"].ID + NetworkSecretRequestedID = MgmtContractABI.Events["NetworkSecretRequested"].ID + NetworkSecretRespondedID = MgmtContractABI.Events["NetworkSecretResponded"].ID + RollupAddedID = MgmtContractABI.Events["RollupAdded"].ID + ImportantContractAddressUpdatedID = MgmtContractABI.Events["ImportantContractAddressUpdated"].ID ) func lazilyLogReceiptChecksum(block *types.Header, receipts types.Receipts, logger gethlog.Logger) { diff --git a/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go b/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go index a869b85887..d6184cc4d0 100644 --- a/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go +++ b/go/ethadapter/mgmtcontractlib/mgmt_contract_lib.go @@ -153,9 +153,6 @@ func (c *contractLibImpl) CreateBlobRollup(t *ethadapter.L1RollupTx) (types.TxDa return nil, fmt.Errorf("failed to make sidecar: %w", err) } - //for i, b := range blobHashes { - // println("MGMT CONTRACT creating blob with hashes ", b.Hex(), " at index: ", i) - //} return &types.BlobTx{ To: *c.addr, Data: data, diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 54ac6db970..19feb8ee34 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -790,10 +790,6 @@ func (g *Guardian) calculateNonRolledupBatchesSize(seqNo uint64) (uint64, error) currentNo++ } - if size > 131072 { - println("HERE") - } - return size, nil } diff --git a/go/host/l1/blockrepository.go b/go/host/l1/blockrepository.go index 66f33f94c0..24becbc803 100644 --- a/go/host/l1/blockrepository.go +++ b/go/host/l1/blockrepository.go @@ -270,6 +270,7 @@ func (r *Repository) processManagementContractTx(txData *common.L1TxData, proces processed.AddEvent(common.RollupTx, txData) } default: + // this might want to be an error since we should never see transactions we can't decode r.logger.Warn("Unknown tx type", "txHash", txData.Transaction.Hash().Hex()) } } diff --git a/integration/ethereummock/mgmt_contract_lib.go b/integration/ethereummock/mgmt_contract_lib.go index 6c898131ef..2c29e6104f 100644 --- a/integration/ethereummock/mgmt_contract_lib.go +++ b/integration/ethereummock/mgmt_contract_lib.go @@ -60,9 +60,6 @@ func (m *mockContractLib) GetContractAddr() *gethcommon.Address { func (m *mockContractLib) DecodeTx(tx *types.Transaction) ethadapter.L1Transaction { // Do not decode erc20 transactions, this is the responsibility // of the erc20 contract lib. - if tx.To() == nil { - println("HERE") - } if tx.To().Hex() == depositTxAddr.Hex() { return nil } diff --git a/integration/ethereummock/node.go b/integration/ethereummock/node.go index c65dd5dd70..39b5845ad2 100644 --- a/integration/ethereummock/node.go +++ b/integration/ethereummock/node.go @@ -147,7 +147,21 @@ func (m *Node) TransactionReceipt(_ gethcommon.Hash) (*types.Receipt, error) { } func (m *Node) TransactionByHash(hash gethcommon.Hash) (*types.Transaction, bool, error) { - // First check if the transaction exists in any block + // First check mempool/pending transactions + select { + case tx := <-m.mempoolCh: + if tx.Hash() == hash { + // Put the tx back in the channel + m.mempoolCh <- tx + return tx, false, nil + } + // Put the tx back in the channel + m.mempoolCh <- tx + default: + // Don't block if mempool channel is empty + } + + // Then check if the transaction exists in any block blk, err := m.BlockResolver.FetchHeadBlock(context.Background()) if err != nil { return nil, false, fmt.Errorf("could not retrieve head block. Cause: %w", err) @@ -174,7 +188,8 @@ func (m *Node) TransactionByHash(hash gethcommon.Hash) (*types.Transaction, bool } } - return nil, false, nil + // If we get here, the transaction wasn't found + return nil, false, ethereum.NotFound } func (m *Node) Nonce(gethcommon.Address) (uint64, error) {