Open Tobeyw opened 3 months ago
The format of the NEF hasn't changed with that commit. It seems to only change the allowed size of the script
field from 512*1024
(as defined by MaxScriptLength
) to ushort.max * 2
(as defined by ExecutionEngineLimits.Default.MaxItemSize
).
I'll try out the new 3.6.2. compiler and see if I can reproduce
I tried running the fromBuffer
method using my NEF file generated with the 3.6.2 compiler and it worked.
const myNef = sc.NEF.fromBuffer(
readFileSync(
"path\\to\\nef\\file"
)
)
Do you know which neon-js version you are using?
@cityofzion/neon-js": "^5.5.1",
This is the compiled file of the tested contract. contract.zip
I tried to deploy the contract using other methods and it worked.
Can you please share the code snippet used that caused the error and also what you now use that works? The checksum in the file seems correct, so this is a strange case and we need a bit more information to investigate.
The neonjs
code is loading a different file (\Neo3ContractTest.nef
) than what the C# code is loading (SampleHelloWorld
, link). You previously shared SampleHelloWorld
and that file is correct. I can't say anything about Neo3ContractTest.nef
This is what I tested with other versions of the contract. It has not been updated. The code is the same, just the files are different. Please ignore it.
The problem was occurring because neon-js had a problem when deserializing a compiler that uses all 64 available characters
And since the compiler you are using is probably some version from the master branch instead of the one at NuGet, the compiler name occupies all 64 chars (Neo.Compiler.CSharp 3.6.2+c9ccbb646657240053065ec7c7ff02f106d...
).
I created a PR to fix this problem.
When we deployed the 3.6.2 version contract with
neonjs
, aninvalid checksum
error occurred. I found that the latest version ofn3 compiler 3.6.2
deleted theMaxScriptLength
field of thenefFile file
, which changed the calculation method ofchenkSum
. I guess it may be related to this. https://github.com/neo-project/neo/commit/efa86592d080ebfde685bc87a26177c5bed5431f#diff-e5a9d7d849aceff46a01663d9e6246d09c4c82e49af60f21dc879d05c40481ee