Replies: 2 comments 1 reply
-
What are the concerns about fixing the contract directly? |
Beta Was this translation helpful? Give feedback.
-
Let me be explicit about this point: I am not suggesting we replace the existing BNS contract. I do not think it is ever going to be acceptable or even safe to try and change code or data that is already deployed. After all, the point of having a blockchain run programs is to ensure that those programs remain deployed as-is (for better or worse). This proposal is concerned instead with wrapping an existing contract with a new contract. No modifications to the code or data will be carried out. In fact, this fix does not require a hard fork -- it could be shipped in 2.0. It could be deployed as a soft-fork, where if adopted, miners would never build on blocks that contained direct contract-calls to the old BNS contract. |
Beta Was this translation helpful? Give feedback.
-
It has come to our attention that the BNS
name-renewal
function has at least two bugs:The latter bug can be worked around with a
name-transfer
, but the former is concerning. We don't want squatters.Fixing this is a consensus-breaking task, so it'll have to be done as part of Stacks 2.1. I think the least-risky way to do this is to simply create a BNS "wrapper contract" called
.bns-2.1
, which wraps all thedefine-public
BNS methods with stubs that simply run acontract-call?
to the corresponding BNS method. Forname-renewal
specifically,.bns-2.1
will first call the originalname-renewal
contract, and if successful, will then burn the requisite renewal fee and run aname-transfer
. We'd do contract-call interception to make it so that all calls todefine-public
methods in.bns
will get rerouted to.bns-2.1
. So,.bns
would be put into "read-only" mode, and.bns-2.1
would in most cases simply do whatever.bns
does.So,
.bns-2.1
would look like the following:We'd update the cost functions for these methods so that the cost to load the contract in the inner
contract-call?
gets ignored, and we'd make it so the newname-renewal
method takes the same runtime as the oldname-renewal
.What do you all think about this?
cc @kantai @lgalabru @pavitthrap @reedrosenbluth @zone117x @gregorycoppola
Beta Was this translation helpful? Give feedback.
All reactions