-
Notifications
You must be signed in to change notification settings - Fork 81
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
network: add notary request payload #1582
network: add notary request payload #1582
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1582 +/- ##
========================================
Coverage 82.39% 82.40%
========================================
Files 238 240 +2
Lines 18833 19052 +219
========================================
+ Hits 15518 15700 +182
- Misses 2322 2356 +34
- Partials 993 996 +3
Continue to review full report at Codecov.
|
033af91
to
8b459e0
Compare
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.
One thing really worrying me here is tying request pool to the Blockchain
. I'd really like to keep it in the network.Server
somewhere.
Another big topic is separation of concerns between payload/pool/service checks. On one hand, I'd like to minimize the burden on non-service nodes (theoretically we could allow exchanging abstract blobs across the network just checking for the signature and deposit), on the other broadcasting invalid (to be rejected by the service) requests doesn't help the network either.
@@ -934,6 +947,11 @@ func (bc *Blockchain) GetGoverningTokenBalance(acc util.Uint160) (*big.Int, uint | |||
return &neo.Balance, neo.LastUpdatedBlock | |||
} | |||
|
|||
// GetDepositFor returns GAS amount deposited to Notary contract for the specified account. | |||
func (bc *Blockchain) GetDepositFor(acc util.Uint160) *big.Int { | |||
return bc.contracts.Notary.BalanceOf(bc.dao, acc) |
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.
I see how dependency on native contracts may prevent this from being done outside of core
. May be we can do something like what was done in #1427.
E.g. updating GetBalance()
function during OnPersistEnd()
.
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.
We have (*NotaryPool).PostBlock
now, which can make use of Blockchainer
. Do we still need this updating function?
0aa3339
to
c183fd4
Compare
3f2c483
to
3bf557b
Compare
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.
Looks good, VerifyAndPoolPayload
for state-dependent things and isValid
for state-independent. All the logic is in place and just needs to be moved a little.
016c56f
to
9cbf6a0
Compare
7e88649
to
71abc3d
Compare
404b5d8
to
4631f7d
Compare
1858dd9
to
a69f9a7
Compare
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.
Looks good.
6b48a8a
to
e8245a5
Compare
We must be sure that stack has no other items before returning `false` verification result. It is an error in both cases, but by preserving the order we know exactly that it was correct `false` on stack.
It will help us to distinguish proper `false` verification result from various verification errors.
It's a bug, we have to reserve proper amount of GAS from verification gas limit for NotaryAssisted attributes.
e8245a5
to
0b5cf78
Compare
Close #1546.