-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Send contract deploy notification before calling _deploy? #3095
Comments
The contract is deployed. This event is emitted when your |
That's not what I'm suggesting. I'm suggesting to put
at the beginning of the function (before the |
At the same time, this behavior existed for quite some time already, some other code can depend on the order we have now. |
On TestNet T5 i don't even get |
I can't tell whether you think this is a problem or not. The C# node does not store notifications for transactions that failed so the order there doesn't matter. One could even have a contract deploy that succeeds but some other contract call that happens after the deploy (in the same script) that fails.
I can't come up with an example what code would depend on order, got an example? When parsing |
That is not normal. http://seed1t5.neo.org:20332 |
At first I thought that THROW and exception handling might be a problem and the proposal should be rejected right away, but turns out that's not the case, so I've just tried to think about other potential consequences. At the moment I don't see any clear problems other than potential incompatibility. It's just a conceptual question, when we consider contract to be deployed. If we're to compare it to NEP-17 then
Meh. Hi, nspcc-dev/neo-go#3189. And no, I don't think C# node behavior is the best one wrt this. But it's a bit different story.
Me neither, but some lazily coded thing that expects its deployment event in |
Ah yes, so simple I didn't even consider that 😅 |
What you should do in the meantime is emit your own deploy event in |
I'm not stand with you on this point. Actually you can calculate an contract address you will deploy to and transfer NEP-17 to the contract address first. Then deploy the contract successfully. |
I've been meaning to ask this for a long time. For this piece of code
neo/src/Neo/SmartContract/Native/ContractManagement.cs
Lines 98 to 103 in a7db45c
Is there a specific reason why we are sending the
Deploy
notification after calling_deploy
? If not, can we swap it around?The current order has some side effects on the application logs. For example for the T5 transaction
0x208ba62b6d52410ed2b8fe36a2cc6f5072442d50e2b0967c7bd4c7a1f4e0fd7a
the notifications list is as followsThe second notification is the deployment of contract
0xb0868db5bc45836be80e7af20ff6cad192f0206a
, whereas the first notification is a transfer for the just deployed contract mentioned. In other words the order of notifications to me looks wrong because you can't transfer if the contract is not yet deployed (note: storing of the contract to the storage snapshot is done before we reach the code snippet above). Having this in chronological order would make it easier to consume the applicationlog as the hash in thecontract
field of a notification will always have an existing contract if parsed in order (because it will have had a deploy event prior to it).The text was updated successfully, but these errors were encountered: