Open ashutoshvarma opened 1 year ago
found an unexpected start function with index 58
this error means that wasm code exported a start
function which is illegal in contract
@yjhmelody did you get a chance to take a look at the fix (or the one suggested in this issue ).
@yjhmelody
Just wanted to bump this since this is a critical bug. The ask! v0.4.0 cannot be used with new pallet-contracts
(polkadot-v0.9.32
or higher) due to: -
__unstable__
that are stabilized in new pallet-contracts
versionsstart
function (for init stdlib) which is now illegal in contracts (new AS supports --exportStart <some-init-name>
which can be used to export start function as either deploy()
or call()
. Not sure how will that work)I believe it should be top priority as without fixing this ask! is essentially broken for all major parachains.
Ok, will be updated
AS always export start function (for init stdlib) which is now illegal in contracts (new AS supports --exportStart
which can be used to export start function as either deploy() or call(). Not sure how will that work)
That's not true. You should config it such as:
{
"targets": {
"debug": {
"sourceMap": true,
"debug": true
},
"release": {
"sourceMap": false,
"optimizeLevel": 3,
"shrinkLevel": 2,
"converge": false,
"noAssert": false
}
},
"options": {
"transform": ["ask-transform", "as-serde-transform"],
"importMemory": true,
"initialMemory": 2,
"maximumMemory": 16,
"noExportMemory": true,
"runtime": "stub",
"use": "abort=",
"disable": ["Sign-extension"]
}
}
or inherent this config:
"extends": "ask-lang/asconfig.json",
I did not see start
function when I did the above.
Oh, I misunderstood, indeed, I need to study further
Related issues about start
functions:
Problem: -
Error while deploying contracts that contains methods that deletes storage states. That includes operation like
Mapping.delete()
that callenv().clearContractStroage()
.Temporary Fix: -
Commented out the new
seal_clear_storage
from__unstable__.ts
, that overshadows the oldseal_clear_storage
fromseal0.ts
https://github.com/ask-lang/ask/blob/a1bd060593b247bc0e2a9d0b5bc88f95ec3fdfa1/as-packages/as-contract-runtime/assembly/unstable.ts#L34-L35
Substrate Contracts Node Log
v0.22
v0.23
Steps to reproduce: -
Build and deploy any contract that has
delete()
method. Below is the minimal reproduction contract.Notes (Not related to this issue) :-
Cannot deploy any contract build with
ark-lang
v0.4.0 on latestsubstrate-contracts-node
v0.23. Always fails with below error.Maybe related to paritytech/substrate#207