vm: don't use Stack for istack

We don't use all of the Stack functionality for it, so drop useless methods
and avoid some interface conversions. It increases single-node TPS by about
0.9%, so nothing really important there, but not a bad change either. Maybe it
can be reworked again with generics though.
This commit is contained in:
Roman Khimov 2022-11-17 22:06:49 +03:00
parent 2bcb7bd06f
commit cb64957af5
8 changed files with 35 additions and 79 deletions

View file

@ -41,7 +41,7 @@ func GetCallingScriptHash(ic *interop.Context) error {
// GetEntryScriptHash returns entry script hash.
func GetEntryScriptHash(ic *interop.Context) error {
return ic.VM.PushContextScriptHash(ic.VM.Istack().Len() - 1)
return ic.VM.PushContextScriptHash(len(ic.VM.Istack()) - 1)
}
// GetScriptContainer returns transaction or block that contains the script