Skip to content

Commit

Permalink
Check parent runtime allowInternal when making a new Runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Nov 17, 2020
1 parent ce91469 commit 5c791cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chain/vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ func (vm *VM) makeRuntime(ctx context.Context, msg *types.Message, parent *Runti
}

if parent != nil {
// TODO: The version check here should be unnecessary, but we can wait to take it out
if !parent.allowInternal && rt.NetworkVersion() >= network.Version7 {
rt.Abortf(exitcode.SysErrForbidden, "internal calls currently disabled")
}
rt.gasUsed = parent.gasUsed
rt.origin = parent.origin
rt.originNonce = parent.originNonce
Expand Down

0 comments on commit 5c791cd

Please sign in to comment.