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

fix: Check if expression can be added to a block #685

Merged
merged 10 commits into from
Apr 4, 2023

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Mar 9, 2023

fixes LNG-81
fixes LNG-122

@DieMyst DieMyst requested a review from alari March 9, 2023 15:47
@linear
Copy link

linear bot commented Mar 9, 2023

LNG-81 Invalid AIR is generated if value is returned immediately from function call

Peer.identify happens on %init_peer_id%, while should've happen on relay.

% aqua --version
0.7.4-331
import Info, Peer from "fluencelabs/aqua-lib/builtin.aqua"

func bug_get_info() -> Info:
    on HOST_PEER_ID:
        <- Peer.identify()
% aqua run --print-air -i src/aqua/basic.aqua -f 'bug_get_info()' --addr stage-02
(xor
 (seq
  (seq
   (seq
    (seq
     (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
     (call %init_peer_id% ("peer" "identify") [] identify)
    )
    (call %init_peer_id% ("--after-callback-srv-service--" "console-log") [identify])
   )
   (call %init_peer_id% ("--finisher--" "--finish-execution--") [])
  )
  (xor
   (call %init_peer_id% ("callbackSrv" "response") ["ok"])
   (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
  )
 )
 (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)

Local service error, ret_code is 1, error message is '"The JS implementation of Peer does not support \"peer.identify\""'

Try 'aqua --help' for usage instructions

@linear
Copy link

linear bot commented Mar 9, 2023

LNG-122 RangeError: Maximum call stack size exceeded

func bug() -> string:
    arr: *string
    for a <- arr:
        <- a
aqua run --print-air -i loop.aqua -f 'bug()' --addr stage-01
scala.scalajs.js.JavaScriptException: RangeError: Maximum call stack size exceeded
  at aqua.model.transform.topology.Topology$For$.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:45834:132)
  at aqua.model.transform.topology.Topology.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:119724:124)
  at aqua.model.transform.topology.Topology$SeqNext$.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:46019:37)
  at aqua.model.transform.topology.Topology.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:119724:124)
  at aqua.model.transform.topology.Topology$For$.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:45842:35)
  at aqua.model.transform.topology.Topology.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:119724:124)
  at aqua.model.transform.topology.Topology$SeqNext$.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:46019:37)
  at aqua.model.transform.topology.Topology.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:119724:124)
  at aqua.model.transform.topology.Topology$For$.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:45842:35)
  at aqua.model.transform.topology.Topology.beginsOn(file:///Users/folex/.nvm/versions/node/v16.13.2/lib/node_modules/fluencelabs/aqua/aqua.js:119724:124)
% aqua --version
0.10.3

@DieMyst DieMyst changed the title bug: Check if expression can be added to a block fix: Check if expression can be added to a block Mar 9, 2023
@DieMyst DieMyst merged commit 2394a9b into main Apr 4, 2023
@DieMyst DieMyst deleted the LNG-81_return_expr_wrong_indentation branch April 4, 2023 13:02
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

Successfully merging this pull request may close these issues.

2 participants