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
Integrated-fixed-arwen-getCompiledCode #2430
Integrated-fixed-arwen-getCompiledCode #2430
Conversation
@@ -580,7 +580,7 @@ | |||
|
|||
[VirtualMachine] | |||
[VirtualMachine.Execution] | |||
OutOfProcessEnabled = true | |||
OutOfProcessEnabled = false |
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 would be reverted later?
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.
don't think so. the engine is save now to be used inprocess always
gasLimit := uint64(10000000000) | ||
|
||
scCode := arwen.GetSCCode("../testdata/delegation/delegation_v0_5_1_full.wasm") | ||
// 17918321 - stake in active - 11208675 staking in waiting - 28276371 - unstake from active |
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.
Does this comment still apply?
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. it is for testing purposes.
return MetachainShardId, nil | ||
} | ||
|
||
shardID, err := strconv.ParseInt(shardIDStr, 10, 64) |
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.
ParseInt(shardIDStr, 10, 32)
- but it really does not matter in this case, actually.
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.
it was copy paste from existing code.
compiledScStorage storage.Storer | ||
configSCStorage config.StorageConfig | ||
workingDir string | ||
nilStorage bool |
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.
Perhaps use the same name here, nilCompiledSCStore
?
cmd/node/factory/structs.go
Outdated
@@ -2473,7 +2484,7 @@ func CreateLatestStorageDataProvider( | |||
) (storage.LatestStorageDataProviderHandler, error) { | |||
directoryReader := storageFactory.NewDirectoryReader() | |||
|
|||
latestStorageDataArgs := storageFactory.ArgsLatestDataProvider{ | |||
latestStorageDataArgs := lastestData.ArgsLatestDataProvider{ |
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.
latestData instead lastestData
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.
renamed
Uint64Converter: TestUint64Converter, | ||
BuiltInFunctions: builtInFuncs, | ||
DataPool: tpn.DataPool, | ||
NilCompiledSCStore: true, |
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.
You can switch lines 1205 with 1206, as almost everywhere NilCompiledSCStore is the last argument :)
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.
done
Uint64Converter: &mock.Uint64ByteSliceConverterMock{}, | ||
BuiltInFunctions: builtInFunctions.NewBuiltInFunctionContainer(), | ||
DataPool: datapool, | ||
NilCompiledSCStore: true, |
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.
You can switch lines 36 with 37, as almost everywhere NilCompiledSCStore is the last argument :)
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.
done
compiledScStorage storage.Storer | ||
configSCStorage config.StorageConfig | ||
workingDir string | ||
nilStorage bool |
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.
nilCompiledSCStore ?
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.
renamed
nilStorage: args.NilCompiledSCStore, | ||
} | ||
|
||
err = blockChainHookImpl.makeCompiledSCStorage() |
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 method is already called in ClearCompiledCodes whch is called below. Could be removed from here?
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.
No. As first you need to create. Empty it and recreate it. You want a clean storage.
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.
ok
@@ -544,10 +553,41 @@ func (bh *BlockChainHookImpl) ClearCompiledCodes() { | |||
bh.compiledScPool.Clear() | |||
err := bh.compiledScStorage.DestroyUnit() |
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.
Should not be done first Close (line 559) and afterwards DestroyUnit ?
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.
Nom destroy is the one cleaning the storage.
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.
ok
@@ -1,4 +1,4 @@ | |||
package factory | |||
package lastestData |
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.
latestData instead lastestData. Also rename the folder
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.
renamed
@@ -1,4 +1,4 @@ | |||
package factory | |||
package lastestData |
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.
latestData instead lastestData. Also rename the folder
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.
renamed
New arwen release integrated.