ApeWorX / ape-optimism

Optimism network provider plugin for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
9 stars 9 forks source link

Optimism `TransactionNotFound` Error #14

Open Tburm opened 1 year ago

Tburm commented 1 year ago

Environment information

$ ape --version
0.5.9

$ ape plugins list
Installed Plugins:
  etherscan    0.5.4
  ens          0.5.1
  optimism     0.5.2
  infura       0.5.3
  solidity     0.5.4
$ cat ape-config.yaml
name: ape-interact

plugins:
  - name: solidity
  - name: etherscan
  - name: infura
  - name: optimism
  - name: ens

optimism:
  mainnet:
    transaction_acceptance_timeout: 180

What went wrong?

When running two subsequent transactions, the second transaction always fails with the error TransactionNotFound. However, this transaction is actually submitted and confirmed onchain. It fails to receive the receipt for the transaction hash of my second transaction.

Here is some pseudocode for the transactions:

from ape import project, accounts

def main():
    # import account
    account = accounts.load('account')

    # create contract
    contract = project.Contract.at("0x00000000")

    # run functions
    receipt_1 = contract.functionOne(sender=account)
    receipt_2 = contract.functionTwo(sender=account)

This script fails on the line which starts with receipt_2 = when I run it using ape-optimism

NotPeopling2day commented 1 year ago

Are you running this on local or a live network when getting the error? If on a live network, does it only occur there or also on local?

Tburm commented 1 year ago

I have only run this on a live network. I'm using optimism:mainnet:infura. I have not tried this on a local fork on the network.

platschi commented 1 year ago

I am having the same issue with above on live network; first tx usually goes through successfully, second tx usually results in TransactionNotFound error.