-
Notifications
You must be signed in to change notification settings - Fork 136
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
Proposal to allow attached_deposit in view contexts #418
Conversation
Your Render PR Server URL is https://nomicon-pr-418.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-cd8626irrk04vs7clvb0. |
I support this proposal. It can probably be extended to other methods like Btw, I don't think this requires a protocol version upgrade, given this only changes the behavior of view methods which can be done today by some clients without any impact on the network. |
neps/nep-0418.md
Outdated
pub fn attached_deposit(&mut self, balance_ptr: u64) -> Result<()> { | ||
self.gas_counter.pay_base(base)?; | ||
|
||
if self.context.protocol_version < VIEW_ATTACHED_DEPOSIT_PROTOCOL_VERSION && self.context.is_view() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @mfornet mentioned, it seems that this proposal does not necessarily trigger a protocol change, which lowers the barrier for this NEP to be approved, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that not a side effect we want to avoid? ie someone querying a function at a historical block and it giving inconsistent results back before and after updating this? Do we not have any guarantees about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be considered a client-breaking change update, but it isn't a protocol upgrade. If there were more than one client out there, it could be possible that some clients would implement these features in different ways.
I understand that making this change could break some assumptions about the code that has been written already that relies on current behavior. But even if you do a Protocol Upgrade, it won't solve the issue for them (users can't pin an older protocol version).
IMO we should use the proposed behavior for legacy blocks as well, but I understand that if this means breaking too many apps, it is unacceptable. In that case, we can apply this behavior after some blocks. Even if the choice is to use this strategy after some fixed block, I still think no Protocol Version update is required (just the client version).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I guess my intuition was that view
semantics were built into the protocol. I guess that's technically not the case.
I'll change the proposal to not change behaviour based on network upgrade, and we can evaluate and try to minimize the risk of this known unknown and think of other potential risks.
@near/wg-protocol I reviewed this NEP as a moderator and it looks good. Please, review and cast your decision in the comments, and let @near/nep-moderators know when you want to move forward to the voting stage. |
I cannot think of a sensible value for |
Co-authored-by: Vlad Frolov <frolvlad@gmail.com>
One suggestion is to use Outside of the scope of this PR but still relevant: Ideally, we should be able to do dry runs of |
@mfornet Do you think this NEP is ready to be reviewed by the whole Tooling Working Group and potentially getting into the voting stage next? |
As @frol mentioned above, we would like to schedule a working group meeting to review this NEP. Before we proceed, we would like to get closer to a consensus on this NEP. @volovyks @DavidM-D @ailisp Could you please fully read this NEP and comment in the thread if you are leaning with approving or rejecting it? Please make sure to include your rationale and any feedback that you have for the author. Thank you. |
As a working group member, I lean towards approving this NEP based on the rationale and security concerns. Based on my knowledge on protocol and contract tooling, proposed solution is reasonably good addition to the tooling with trivial security implications to the protocol. The drawbacks is acceptable. The unsolved issue is also not a big problem. |
As a working group member, I lean towards approving this proposal based on existing discussions in this PR, Zullip and rationale from @austinabell in the NEP itself. The breaking change created by this change is extremely unlikly to affect real contracts. At the same time I agree that it will improve DevEx. Other proposals, like |
I also approve this proposal. It seems sensible and well thought through. |
As the moderator, I would like to thank the author @austinabell for submitting this NEP, and for the @near/wg-tooling working group members for your review. Based on the voting indications above, it seems like this proposal is close to a decision. We are therefore scheduling the first Tools Working group meeting this week, where this NEP can enter the final voting stage. Anyone can discuss the technical details by adding your comments to this discussion. And join the call to learn about the final decision and how to get more involved. Meeting Info |
Thank you to those who attended the first Tools Working Group meeting yesterday! The working group members reviewed the NEP and reached the following consensus: Status: Approved
Meeting Recording: @austinabell Thank you for authoring this NEP! Next Steps:
|
I updated the branch for near/nearcore#7936 (comment) but just can't push to the PR branch as it's a nearcore repo, and I don't have access. Not sure if anything else is blocking that coming in now that this seems "accepted" |
…ressed in the review and mentioned in the Decision Context section
@austinabell Thanks for working on the NEP and PR to nearcore! Congrats everyone with one more NEP being merged! 🎉 |
) Description copied from #7936 Accompanying PR for near/NEPs#418 It's very simple, so I figured I'd just open. I'm generally uncomfortable with how certain context is redundant for view context, and it wasn't clear whether or not this check should be kept and just return 0 for attached deposit for view contexts. Seems like the only logic which uses the view logic [sets the deposit to 0](https://github.com/near/nearcore/blob/d13f66bcdf71ff6a6fdf9f31edad1182283a7523/runtime/runtime/src/state_viewer/mod.rs#L224), but I'm not sure if it will ever be wanted to be able to configure context for view calls in the future.
…ar#8433) Description copied from near#7936 Accompanying PR for near/NEPs#418 It's very simple, so I figured I'd just open. I'm generally uncomfortable with how certain context is redundant for view context, and it wasn't clear whether or not this check should be kept and just return 0 for attached deposit for view contexts. Seems like the only logic which uses the view logic [sets the deposit to 0](https://github.com/near/nearcore/blob/d13f66bcdf71ff6a6fdf9f31edad1182283a7523/runtime/runtime/src/state_viewer/mod.rs#L224), but I'm not sure if it will ever be wanted to be able to configure context for view calls in the future.
…ar#8433) Description copied from near#7936 Accompanying PR for near/NEPs#418 It's very simple, so I figured I'd just open. I'm generally uncomfortable with how certain context is redundant for view context, and it wasn't clear whether or not this check should be kept and just return 0 for attached deposit for view contexts. Seems like the only logic which uses the view logic [sets the deposit to 0](https://github.com/near/nearcore/blob/d13f66bcdf71ff6a6fdf9f31edad1182283a7523/runtime/runtime/src/state_viewer/mod.rs#L224), but I'm not sure if it will ever be wanted to be able to configure context for view calls in the future.
A small UX improvement for contract developers. Markdown https://github.com/near/NEPs/blob/austin/view_attached_deposit/neps/nep-0418.md
Original discussion: https://near.zulipchat.com/#narrow/stream/295306-pagoda.2Fcontract-runtime/topic/attached_deposit.20view.20error