-
Notifications
You must be signed in to change notification settings - Fork 8
Error: Abort execution #57
Comments
Can you add the mapping.ts file in the issue? It says |
i haven't modified the mapping.ts file since forking it from this repo, the changes are shown here https://github.com/ltfschoen/zkgraph/blob/001774bd677e10629108b93c23fc65770bb817f4/src/mapping.ts. the only changes i made are shown in this pull request #56 //@ts-ignore
import { require } from "../lib/common/zkwasm";
import { Bytes, Event, BigInt } from "../lib/common/type";
export function handleEvents(events: Event[]): Bytes {
let state = new Bytes(0);
if (events.length > 0) {
state = events[0].address;
}
require(state.length == 20);
return state;
} |
Got it. Thanks for sharing the code. Is the error output like this? > exec-local
> node api/exec.js 9438792
[*] Source contract address: 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
[*] Source events signatures: [
'0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1'
]
[*] 174 receipts fetched from block 9438792
[*] 0 event matched
[-] zkwasm require condition is false
file:///Users/msfew/github/zkgraph/api/common/zkwasm_mock.js:79
throw Error("Abort execution"); |
yes the output is:
|
In the output, it is shown that You can fix this by:
Hope this helps. |
so i'm using the code with my changes in this pull request #56 in that pull request i modified config.js to use a Goerli testnet JSON RPC endpoint https://ethereum-goerli-rpc.allthatnode.com and to use the private key of an Ethereum address that has 0.1 Goerli testnet eth tokens. i provided the them as environment variables from a .env file, and confirmed they were successfully being read by the config.ts file. i also ran the following, which returned
then i ran the following commands by following the readme file, where i'm using Node.js v16.18.1
this was successful and generated the following files build/zkgraph_local.wasm and build/zkgraph_local.wat but i just noticed that the contents of the default config.js file includes the following:
Question: But when compiled it does NOT generate a build/zkgraph_full.wasm file, but i'm not sure if that file is necessary, how do I generate the build/zkgraph_full.wasm file? also, are the following Hyper Oracle endpoints that are in the config.js file working?
then i ran the following where i encountered the error.
which output
i used debugging and found the error occurred when it reached this line of code https://github.com/ltfschoen/zkgraph/blob/001774bd677e10629108b93c23fc65770bb817f4/api/exec.js#L81 let state = asmain_exported(rawReceipts, matchedEventOffsets); because
it outputs Question: But why is it calling in the uniswap example in zkgraph/example/uniswapprice/mapping.ts they explicitely call it's actually not even running the mapping.ts file as i tried adding a console.log in it and it didn't get output when i ran and it's also not caused by zkgraph/lib/common/entries.ts where it has the code i just had another look at it and found that the value of the variables were
so there must be something wrong with the 2nd and 3rd argument that i'm providing to the function, and maybe that's why its not processing the events
it's getting those arguments earlier in exec.js file here https://github.com/ltfschoen/zkgraph/blob/001774bd677e10629108b93c23fc65770bb817f4/api/exec.js#L31, where it loads the the contents of the default src/zkgraph.yaml is shown here https://github.com/ltfschoen/zkgraph/blob/001774bd677e10629108b93c23fc65770bb817f4/src/zkgraph.yaml, extract below
where on Ethereum Mainnet the source address is https://etherscan.io/address/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc#code, and corresponds to the UniswapV2Pair smart contract. But i'm using the Goerli Testnet provider, and I suspect there wouldn't be any events in the block on Goerli Testnet if nobody is using that contract. Question: What value should I change the "target blockchain network" Question: What does Question: What are the "target smart contract address" values listed in I thought the "source smart contract" that I deploy on the Goerli Testnet would be used to emit events in a specific block. Then when we run i just discovered https://docs.hyperoracle.io/mvp/testing-guide, so i'm going to see if that provides more insight |
Question: But when compiled it does NOT generate a build/zkgraph_full.wasm file, but i'm not sure if that file is necessary, how do I generate the build/zkgraph_full.wasm file?
Question: But why is it calling require with a value of 0??
Question: So is the idea that I need to create and deploy my own custom "source smart contract" on Goerli Testnet as shown in the Hyper Oracle documentation here https://docs.hyperoracle.io/zkgraph/introduction? And call functions in it to emit events in a specific block number, and then specify those events under dataSources > mapping > eventHandlers of src/zkgraph.yaml, and then later provide that block number as a CLI option when later run npm run exec-local -- <BLOCK_NUMBER>?
Question: What value should I change the "target blockchain network" network key to for dataSource and dataDestination if I want to use Goerli Testnet instead of Ethereum Mainnet? Should I just change it to a value of goerli
Question: What does apiVersion: 0.0.1 in src/zkgraph.yaml correspond to?
Question: What are the "target smart contract address" values listed in dataDestinations address used for (i.e. address: '0x123abc'), and are they necessary?
|
thanks, yes i got new endpoints from https://www.allthatnode.com/ethereum.dsrv and changed the endpoint from Goerli Testnet ethereum-goerli-rpc.allthatnode.com to Ethereum Mainnnet ethereum-mainnet-rpc.allthatnode.com, and then ran
|
Refer to this PR #56 where I tried to setup this repo by following the README file, but when I got up to the step of running
npm run exec-local -- 9438792
, it crashed with errorwhich happens on this line https://github.com/hyperoracle/zkgraph/blob/master/api/exec.js#L81
The text was updated successfully, but these errors were encountered: