Glow-Lang / glow

The Glow language for Blockchain Decentralized Applications.
https://glow-lang.org
Apache License 2.0
58 stars 8 forks source link

Small values of timeoutInBlocks don't work #413

Closed plotnick closed 2 years ago

plotnick commented 2 years ago

Starting one side of the buy_sig contract with a --timeout-in-blocks argument of less than ~5 fails with an execution reverted error. It should instead time out and reclaim the escrow succesfully.

plotnick commented 2 years ago

Given a local test network PET and a contacts DB with: Alice ↳ pet 0xa11cE3d7466d87169693843785b4bAa89B1BeA94 (alice) 🔑

  1. Bob ↳ pet 0xb0bCd0F25DAa620352FDeD9824527081265447eF (bob) 🔑 I start the interaction with Alice as Buyer using this command:
    glow start-interaction --evm-network pet --max-initial-block '%10' --timeout-in-blocks 1 --glow-app buy_sig --my-identity alice --role Buyer --database alice --assets '{"DefaultToken": "PET"}' --participants '{"Buyer": "0xa11cE3d7466d87169693843785b4bAa89B1BeA94", "Seller": "0xb0bCd0F25DAa620352FDeD9824527081265447eF"}' --params '{"digest": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "price": 123451234512345}'

    This should be recast as a failing integration test.

AlexKnauth commented 2 years ago

A modified command to reproduce the same error on my machine:

glow start-interaction --evm-network pet --test --max-initial-block '%10' --timeout-in-blocks 1 --glow-app buy_sig --my-identity t/alice --role Buyer --database alice --assets '{"DefaultToken": "PET"}' --participants '{"Buyer": "0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1", "Seller": "0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD"}' --params '{"digest": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "price": 123451234512345}'

And I've started a branch timeout2 with a new integration test to reproduce the same thing.

AlexKnauth commented 2 years ago

Closed by https://github.com/fare/gerbil-ethereum/pull/55 and https://github.com/Glow-Lang/glow/pull/416