Glow-Lang / glow

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

Handshake not generated/ code blocks if contract creator doesn't have enough funds #421

Open bennewhall opened 2 years ago

bennewhall commented 2 years ago

Description of Issue

Setting up geth

In one terminal I started up a Private Ethereum Network with ./gerbil-ethereum/scripts/run-ethereum-test-net.ss

Setting up Identities

In one terminal I generated two identities. ./glow generate-identity -E pet -N alice ./glow generate-identity -E pet -N bob and did not give funds to each of them with ./glow faucet

First Contract run attempt

I then started alice's end of the interaction in another terminal with ./glow start-interaction -E pet and selected the buy-sig interaction, alice as the identity, Buyer as the role, bob as the Seller, PET as the token, entered a digest, and selected a Max initial block greater than the current block number, and a price of 1

After doing this, glow generated a command for other participants to generate the same agreement, but blocked and never generated a handshake and gave no explanation (no funds)

Adding Funds to the identities

After exiting the previous contact attempt, I then added funds to bob and alice with ./glow faucet -E pet -t alice ./glow faucet -E pet -t bob

Second Contract Run attempt

After adding funds, I ran the same interaction as described in First Contract run attempt above, and the contract ran successfully

Restarting geth and running the same interaction

In another terminal, I stopped the Private Ethereum Network with killall -HUP geth and then restarted with ./gerbil-ethereum/scripts/run-ethereum-test-net.ss

Third Contract Run attempt

After the Private Ethereum Network restart, I ran the steps in First Contract run attempt again, and another agreement was generated for bob to run, no error was thrown, and the code blocked when creating a handshake

Summary

Notes

From inspection, it seems that the code starts blocking in the deploy-contract function in runtime/participant-runtime.ss