question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: "This method only supports Buffer but input was..." on ARM based Mac M1

See original GitHub issue

Running the test suite will cause an important warning and an error on Mac M1, which both won’t happen on Intel-based Mac:

  1. The Warning of exceedes code size:
Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
 --> contracts/mocks/GovernorCompatibilityBravoMock.sol:9:1:
  |
9 | contract GovernorCompatibilityBravoMock is GovernorCompatibilityBravo, GovernorTimelockCompound, GovernorVotesComp {
  | ^ (Relevant source part starts here and spans across multiple lines).
  1. The Error:
Compilation finished successfully
An unexpected error occurred:

Error: This method only supports Buffer but input was: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
    at Object.exports.assertIsBuffer (/private/tmp/openzeppelin-contracts/node_modules/ethereumjs-util/src/helpers.ts:21:11)
    at Object.exports.privateToPublic (/private/tmp/openzeppelin-contracts/node_modules/ethereumjs-util/src/account.ts:275:3)
    at exports.privateToAddress (/private/tmp/openzeppelin-contracts/node_modules/ethereumjs-util/src/account.ts:285:26)
    at /private/tmp/openzeppelin-contracts/node_modules/@nomiclabs/hardhat-truffle5/src/index.ts:140:41
    at Array.map (<anonymous>)
    at describeContract (/private/tmp/openzeppelin-contracts/node_modules/@nomiclabs/hardhat-truffle5/src/index.ts:139:11)
    at /private/tmp/openzeppelin-contracts/node_modules/@nomiclabs/hardhat-truffle5/src/index.ts:162:20
    at env.contract (/private/tmp/openzeppelin-contracts/hardhat/env-contract.js:8:5)
    at Object.<anonymous> (/private/tmp/openzeppelin-contracts/test/access/AccessControl.test.js:7:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at /private/tmp/openzeppelin-contracts/node_modules/mocha/lib/mocha.js:349:36
er

💻 Environment

MacBook Pro M1 (ARM) with 16 GB RAM MacOS BigSur 11.4

Node: tested with several versions:

  • 16.7.0
  • 15.4.0
  • 14.17.5
  • 12.22.5

📝 Details

git clone git@github.com:OpenZeppelin/openzeppelin-contracts.git
cd openzeppelin-contracts
npm install
npm run test

Importantly, on Intel-based Macs, this error does not occur, no matter which of the Node versions listed above I tested with.

🔢 Code to reproduce bug

no code changes made here, just used master branch

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
itinancecommented, Sep 23, 2021

Hi @Amxx, I had also ethereum-utils or hardhat-truffle already in my mind and try to figure out, if I can get more informations (and probably get in contact with them then). I will keep you guys updated here in this thread.

1reaction
frangiocommented, Oct 6, 2021

This was an issue in Hardhat that was fixed on a recent release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
A buffer overflow vulnerability will typically occur when code: Is ... swaylock Error: "This method only supports Buffer but input was" on ARM...
Read more >
Postgres errors on ARM-based M1 Mac w/ Big Sur
"Bad address" is the message associated with EFAULT , meaning that postgres is passing an invalid pointer to read() or a similar system...
Read more >
Install Windows 11 ARM on M1-based Macs with UTM
For this article, I will get Windows 11 for ARM running on an M1 MacBook Air by using UTM.
Read more >
ML Compute | Apple Developer Forums
I'm using a Xcode Version 13.1 (13A1030d) on MacOS Monterey 12.5.1 (21G83), with Apple M1 Max. It seems this issue is related to...
Read more >
Using toolbox with Big Sur and M1 MacBook? - Psychtoolbox
macOS 11 is not tested and not officially supported in any way with the current ... The M1 ARM Macs only have Apple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found