-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1408 +/- ##
======================================
Coverage 69.9% 69.9%
======================================
Files 72 72
Lines 7773 7773
======================================
Hits 5438 5438
Misses 1444 1444
Partials 891 891 |
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.
Basically smooth, nice work.
return ic.Syscalls().VerifySeal(vi) | ||
} | ||
|
||
func (ic *invocationContext) BatchVerifySeals(vis map[address.Address][]proof.SealVerifyInfo) (map[address.Address][]bool, error) { | ||
// no explicit gas charged |
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.
See #1381 (comment), I hope we can remove the special case.
support/vm/vm.go
Outdated
To: to, | ||
Nonce: nonce, | ||
Value: value, | ||
GasLimit: 5_000_000_000, |
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.
Reference the default gas limit constant, or use a different value (since I don't think this value is actually checked).
Value: value, | ||
GasLimit: 5_000_000_000, | ||
GasFeeCap: big.Zero(), | ||
GasPremium: big.Zero(), |
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 was guessing that the GasLimit above was set non-zero so as to better represent the serialized size of a chain message. If so, these should be non-zero too. If not, just set the unused GasLimit to zero to match
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.
Yes GasLimit is set non-zero for serialization accuracy purposes. We can't set it to zero because then we will hit SysErrOutOfGas immediately. If we set GasFeeCap and GasPremium non-zero we will have to implement base fee burning and miner payments which I want to avoid.
if err != nil { | ||
ic.rt.Abortf(exitcode.ErrIllegalState, "could not save new state") | ||
} | ||
c := ic.StorePut(obj) | ||
actr.Head = c | ||
err = ic.rt.setActor(ic.rt.ctx, ic.msg.to, actr) |
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 need to charge gas for the write of the actor struct into the state tree.
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 is intentionally not charging gas because as I understand the lotus vm code the filecoin protocol does not charge gas for reads and writes from the top level state tree.
4aaaf11
to
e638752
Compare
Broadly looks good. Will look in a bit more detail after a rebase (it's currently a bit confusing to look at diff). |
f41487f
to
5f76287
Compare
- introduce runtime.Pricelist - the price list interface - copy current filecoin pricelist to testing package - charge for gas - return (and ignore) gas used from ApplyMessage - setup large default gas limit - handle out of gas aborts
Since we are all quite busy right now I went ahead and merged to unblock myself more quickly because existing review was thorough, this PR only impacts testing code, and gas calculation implementation errors will only become more apparent as we evaluate test vectors against lotus. |
Closes #1266
I'm aiming for correctness to filecoin protocol / lotus vm now but it is not dangerous if we miss something in review. All inconsistencies externalized in test vectors will register as failures when ran against lotus (which I will then debug and fix)
before releasing them as conformance tests.