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.

Pop from an empty deque

See original GitHub issue

Environment information

  • brownie Version: v1.14.6
  • ganache-cli Version: 6.12.2
  • solc Version: 0.8.2
  • Python Version: 3.8.5
  • OS: mac

What was wrong?

brownie compile err’d out with this stack trace:

WARNING: deployed size of MyContract is 24672.0 bytes, exceeds EIP-170 limit of 24577
 - MyContract
  File "brownie/_cli/__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "brownie/_cli/compile.py", line 50, in main
    proj = project.load()
  File "brownie/project/main.py", line 745, in load
    return Project(name, project_path)
  File "brownie/project/main.py", line 180, in __init__
    self.load()
  File "brownie/project/main.py", line 235, in load
    self._compile(changed, self._compiler_config, False)
  File "brownie/project/main.py", line 92, in _compile
    build_json = compiler.compile_and_format(
  File "brownie/project/compiler/__init__.py", line 142, in compile_and_format
    build_json.update(generate_build_json(input_json, output_json, compiler_data, silent))
  File "brownie/project/compiler/__init__.py", line 313, in generate_build_json
    build_json[contract_alias] = solidity._get_unique_build_json(
  File "brownie/project/compiler/solidity.py", line 260, in _get_unique_build_json
    pc_map, statement_map, branch_map = _generate_coverage_data(
  File "brownie/project/compiler/solidity.py", line 359, in _generate_coverage_data
    pc_list.append({"op": opcodes.popleft(), "pc": pc})
IndexError: pop from an empty deque

It doesn’t have to do only with the contract size being exceeded because I removed some small parts of the code and it worked, but the size was still exceeded. But it seems to happen when the size has been exceeded or is very large.

How can it be fixed?

When I turned the optimizer off this problem stopped

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
realisationcommented, Jun 29, 2021

changing the optimizer runs to 800 seems to solve this problem

0reactions
liam-otcommented, Sep 6, 2022

experienced this with brownie v1.19.0 upgrading to v1.19.1 resolved the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexError: pop from an empty deque · Issue #511 - GitHub
I had this exact problem when I tried using different channels of the same connection in several threads, then I read the FAQ......
Read more >
Python while loop popleft() - ERROR: Empty deque
My deques are created dynamically and can vary in length. In the example below the list is only two items long and could...
Read more >
iostream's write :IndexError: pop from an empty deque
IndexError: pop from an empty deque. What does this mean? I am sure when I calling self._stream.write(data,lambda : self.read_message(sendno, mess_id)), ...
Read more >
pop() method of deque class - Pythontic.com
The pop() method of deque class removes the last element of a deque object and returns the value. Calling pop() on an empty...
Read more >
Issue 31099: Timer error pop from empty deque/list
msg299634 ‑ (view) Author: Randy Henderson (Randy Henderson) Date: 2017‑08‑01 20:50 msg299636 ‑ (view) Author: R. David Murray (r.david.murray) * Date: 2017‑08‑01 20:58 msg299638 ‑...
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