Skip to content
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

How to get the L1 block number or L1 tx hash by the L2 transaction hash? #469

Open
liucan163 opened this issue Nov 30, 2023 · 0 comments
Open

Comments

@liucan163
Copy link

liucan163 commented Nov 30, 2023

I attempted to retrieve the L1 txHash using the provided method in the SDK, but encountered a failure. Upon inspecting the code logic, I noticed that for my transaction, logs==[], and therefore, I couldn't proceed with the next steps. Could you please help me understand how to resolve this issue? Alternatively, are there other methods to obtain the L1 txHash and L1 block number? Thank you.

const crossChainMessenger = new CrossChainMessenger({
l1ChainId: 11155111,
l2ChainId: 11155420,
l1SignerOrProvider: l1Provider,
l2SignerOrProvider: l2Provider,
})
console.log('crossChainMessenger====', crossChainMessenger)
const l2TxHash = "0xc36006a7203af54a148db0bc6d1a59131cda383a667c9b092e468e775ef4d825"
const l1Rcpt = await crossChainMessenger.getMessageReceipt(l2TxHash)
const l1TxHash = l1Rcpt.transactionReceipt.transactionHash
console.log('l1TxHash=======', l1TxHash)

20231130-113432

@liucan163 liucan163 changed the title How to get the L1 block number or L1 tx hash through the L2 transaction hash? How to get the L1 block number or L1 tx hash by the L2 transaction hash? Nov 30, 2023
@tynes tynes transferred this issue from ethereum-optimism/optimism Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant