Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Just some guy
    @fubuloubu
    Does this actually work?
    Just some guy
    @fubuloubu
    yup, appears it does
    does eth-tester use whatever the latest VM class is?
    Jason Carver
    @carver
    yup
    someday we'll get it to load genesis files (need to move the genesis tooling to py-evm first
    Jason Carver
    @carver
    @/all eth-tester v0.3.0-beta.1 is released, with default Istanbul support, and the latest py-evm changes:
    Just some guy
    @fubuloubu
    Nice!
    Sumon Bormon Singh(Dark Prince)
    @BORMONSUMON_twitter
    hello....all keep me your help ,support,advice,assist,security me
    Konstantin Yatsenko
    @kyatsenko
    I have an Ethereum based blockchain and test it by using web3.py API. I wonder, can eth-tester somehow help me to do this easier? Thnks.
    Jacques Wagener
    @jacqueswww
    if it's a ETH/ETC eth-tester can emulate it. But if it's EVMlike i.e. not vanilla ETH EVM then no
    Sumon Bormon Singh(Dark Prince)
    @BORMONSUMON_twitter
    Hello World #all 🙏

    all

    Ben Scherrey
    @scherrey
    Does eth-tester have a mechanism where I can jump back to a previous block and start from that known state? Seems an obvious and very handy capability for thorough testing of all contract conditions.
    Just some guy
    @fubuloubu
    you can use a snapshot
    Ben Scherrey
    @scherrey
    How is that done?
    Ben Scherrey
    @scherrey
    Ah found it - many thanks!
    Ben Scherrey
    @scherrey
    Is it possible from a tx_dict to determine what the name of the public function called for that transaction was?
    Just some guy
    @fubuloubu
    I think the ABI selector might be in there, you'd have to know what those 4 bytes corresponded to
    probably just better off looking directly at the transaction data though
    Peteris Erins
    @Pet3ris
    Eth-tester seems to use a custom MainnetTesterNoProofChain(MiningChain) instead of the MainnetTesterChain provided in py-evm. What's the difference between the two?
    Just some guy
    @fubuloubu
    I believe it skips the PoW
    that's important because if you do things like timewarping like 1000 blocks, even very low difficulty PoW becomes a limiting factor
    Peteris Erins
    @Pet3ris
    @fubuloubu that makes sense, but it seems from the documentation that MainnetTesterChain already has this:
    class MainnetTesterChain(BaseMainnetTesterChain):
        """
        This class is intended to be used for in-memory test chains.  It
        explicitely bypasses the proof of work validation to allow for instant
        block mining.
        It exposes one additional API `configure_forks` to allow for in-flight
        configuration of fork rules.
        """
    Jason Carver
    @carver
    eth-tester has been around for a long time. The no-proof-chain might just predate the py-evm one. Also, IIRC eth-tester starts with the latest hard-fork definition at block 0, and doesn't use mainnet genesis balances.
    Also, it's modified so that the gas limit doesn't trend down as you use it (since you typically only put one transaction per block, which would normally cause downward movement of the block gas limit)
    https://github.com/ethereum/eth-tester/blob/51a208e02205639c37108873ccfddc4d845a0ddd/eth_tester/backends/pyevm/main.py#L170-L175
    Peteris Erins
    @Pet3ris
    @carver ah - that makes a lot of sense, thanks!
    Peteris Erins
    @Pet3ris
    Why does this sequence produce an error? Is this a bug?
    >>> genesis_params = eth_tester.PyEVMBackend._generate_genesis_params(overrides=dict(block_number=1000))
    >>> backend = eth_tester.PyEVMBackend(genesis_params)
    >>> w3 = web3.Web3(web3.Web3.EthereumTesterProvider(backend))
    >>> w3.manager.provider.ethereum_tester.disable_auto_mine_transactions()
    >>> snapshot = w3.manager.provider.ethereum_tester.take_snapshot()
    >>> snapshot
    0
    >>> w3.manager.provider.ethereum_tester.get_block()
    eth_utils.exceptions.ValidationError: Attempt to import block #1000.  Cannot import block b'\xcc?\xed\x08\xbf\\\xa0\xbaH6\x0b\x859\x899jZ?Xs\xe5\x85*\xd5kE\x0e\xc3\xc6\x05\x98\x1c' before importing its parent block at b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
    If I mine a block between getting the snapshot then it works.
    w3.manager.provider.ethereum_tester.mine_block()
    Peteris Erins
    @Pet3ris
    *sorry the last line is meant to be w3.manager.provider.ethereum_tester.revert_to_snapshot(snapshot) instead of get_block
    genesis_params = eth_tester.PyEVMBackend._generate_genesis_params(overrides=dict(block_number=1000))
    backend = eth_tester.PyEVMBackend(genesis_params)
    w3 = web3.Web3(web3.Web3.EthereumTesterProvider(backend))
    w3.manager.provider.ethereum_tester.disable_auto_mine_transactions()
    snapshot = w3.manager.provider.ethereum_tester.take_snapshot()
    w3.manager.provider.ethereum_tester.revert_to_snapshot(snapshot)
    arjuna sky kok
    @arjunaskykok_gitlab
    Any idea when the new version of eth-tester (incorporating this commit ethereum/eth-tester@c12172c) is going to be released to PyPi? Py-Evm 0.3.0a20 has been released and it uses rlp 2.0 however the latest version of eth-tester on PyPi uses rlp less than version 2.0. So it's impossible to use both of them in my open source project. PyPi does not support direct dependency. So I can not use the github version of eth-tester. Thank you so much!