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

ASTDereferencerError: No node with id -18 of type FunctionDefinition #1116

Closed
StackOverflowExcept1on opened this issue Jan 24, 2025 · 4 comments · Fixed by #1118
Closed

ASTDereferencerError: No node with id -18 of type FunctionDefinition #1116

StackOverflowExcept1on opened this issue Jan 24, 2025 · 4 comments · Fixed by #1118

Comments

@StackOverflowExcept1on
Copy link

StackOverflowExcept1on commented Jan 24, 2025

Code of our Solidity project for some reason doesn't pass some checks in your library. Could you please check why? Our code successfully passes the build with solc, but not your AST validation.

ref OpenZeppelin/openzeppelin-foundry-upgrades#93

[FAIL: revert: Failed to run upgrade safety validation: /root/.npm/_npx/e9c2fe9985ed1095/node_modules/solidity-ast/dist/ast-dereferencer.js:73
        throw new ASTDereferencerError(id, nodeType);
              ^

ASTDereferencerError: No node with id -18 of type FunctionDefinition
    at deref (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/solidity-ast/dist/ast-dereferencer.js:73:15)
    at derefNode (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/solidity-ast/dist/ast-dereferencer.js:76:16)
    at curried (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/solidity-ast/dist/ast-dereferencer.js:86:20)
    at getRecursiveFunctionIds (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/@openzeppelin/upgrades-core/dist/validate/run/initializer.js:214:16)
    at getInitializerCallExceptions (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/@openzeppelin/upgrades-core/dist/validate/run/initializer.js:130:40)
    at getInitializerCallExceptions.next (<anonymous>)
    at getInitializerExceptions (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/@openzeppelin/upgrades-core/dist/validate/run/initializer.js:37:20)
    at getInitializerExceptions.next (<anonymous>)
    at validate (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/@openzeppelin/upgrades-core/dist/validate/run.js:138:67)
    at runValidations (/root/.npm/_npx/e9c2fe9985ed1095/node_modules/@openzeppelin/upgrades-core/dist/cli/validate/validations.js:22:41) {
  id: -18,
  nodeType: [ 'FunctionDefinition' ]
}
@StackOverflowExcept1on StackOverflowExcept1on changed the title Can't compile the project after updating @openzeppelin/upgrades-core package to 1.42.0 ASTDereferencerError: No node with id -18 of type FunctionDefinition Jan 24, 2025
@ericglau ericglau transferred this issue from OpenZeppelin/solidity-ast Jan 24, 2025
@ericglau
Copy link
Member

@StackOverflowExcept1on Thanks for reporting. I am working on a fix but would like to test it out. Would it be possible for you to share a repository or contracts that encounter this issue?

@StackOverflowExcept1on
Copy link
Author

StackOverflowExcept1on commented Jan 24, 2025

@ckartik
Copy link

ckartik commented Jan 24, 2025

We're encountering this issue as well in our CI. @ericglau

https://github.com/primev/mev-commit

@ericglau
Copy link
Member

Fixed in @openzeppelin/[email protected]

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 a pull request may close this issue.

3 participants