An issue has been discovered in epoch 2.2, which went live yesterday, Sunday, April 30, 2023, that causes an error when attempting to call a function which takes a trait parameter. The exact problem is still under investigation, but it seems to be caused by an incorrect epoch check in a type-checker function. This bug would be triggered when calling a contract deployed in 2.05 from epoch 2.2. Solutions and workarounds are in progress and being discussed in the stacks-core-devs channel on Discord.
See a reproducible test exposing the problem here - test: test passing traits in 2.2 by obycode · Pull Request #45 · hirosystems/stacks-2-1-testing · GitHub
And a potential fix for the problem here - Fix epoch check for type canonicalization by obycode · Pull Request #3691 · stacks-network/stacks-blockchain · GitHub
Updated May 1 at 10:42pm ET with a summary of new activity
Core developers and contributors are working on a new release to address this issue.
- What’s the bug: Contract calls that use traits as parameters are failing in 2.2. More details in the bug report.
- Who is impacted: Contracts deployed before Stacks 2.1 that have function calls accepting trait inputs are affected.
What’s been done:
- Straightforward workarounds were eliminated as a viable option for builders
- There is a real-time Signal channel where builders affected by this bug can get direct input from core developers and other technical leaders throughout the ecosystem. Please use this form to request to join: Builder Support 5/1
- SIP-023 is in the works to address the issue as soon as possible
- A new release is being worked on actively, it appears it could be made available on May 2
A new release that addresses the trait invocation behavior outlined above is now ready: Release Release 22.214.171.124.0 · stacks-network/stacks-blockchain · GitHub
SIP-023 covers this immediate upgrade to the network to address the impact on certain smart contracts. This ensures key functionality of applications is restored rapidly and was co-authored by several builders in the ecosystem that were experiencing the worst of the effects with their users.
This update essentially amounts to something of a ‘hotfix’ of the latest 126.96.36.199.1 upgrade, but the SIP process was deployed anyway to document the event and include CABs and other reviewers. This upgrade will go live at Bitcoin block 788,240 which is currently estimated for May 4th, 2024 around 1300 UTC.
- This release is set to go live quicker than is typical because of the direct impact on users and the strong support of builders running some of the most used applications. From discussions across channels, it appears clear this upgrade is one everyone wants to see live as soon as possible.
- Exchanges and other integration partners are being contacted and encouraged to upgrade as soon as possible.
Recognizing that the recent upgrades are the first ‘emergency’ upgrades in over 2 years on the Stacks mainnet, there is clearly room for improvement as we’ve now seen two upgrades cause subsequent issues. I’ve set up a public call to discuss this later this month after the upgrade outlined in SIP-022 goes live. My personal goal is that we can look back and find actionable places for improvement with the benefit of complete hindsight on the current situation and full attendance of key contributors that are currently busy working on it. Please attend and share your own goals, thoughts, and possible ways you can contribute .
While stressful and less than ideal, it’s heartening to see the core devs and community come together so rapidly and within hours of discovery, pull together a well-supported new SIP and PR. For any Bitcoin layer and open-source project, being able to quickly and reliably ship network upgrades is important, especially as a response to bugs. Thank you to everyone that has been involved in addressing this issue!
2.3 has now activated and the trait issue is resolved!