-
Notifications
You must be signed in to change notification settings - Fork 8
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
SEC-526 #118
base: dev
Are you sure you want to change the base?
SEC-526 #118
Conversation
dfa3dde
to
4afa2ae
Compare
121a685
to
3813532
Compare
43124cc
to
b1e3a03
Compare
console.log('Execution Shard Key in receipt does not match the calculated key from transaction data.') | ||
} | ||
if (nestedCountersInstance) nestedCountersInstance.countEvent('receipt', 'executionShardKey mismatch') | ||
executionShardKey = extractedKey |
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 wonder if fallback should be to the key which we received in receipt. Just in case our extraction logic has some flaws. We can discuss with design team.
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.
Well, I was thinking about the possibility that the incoming execution shard key from the receipt might contain malicious/falsified information. So, we should instead rely on the shard key we have calculated now.
src/Data/ExtractShardKey.ts
Outdated
return response.accounts | ||
} | ||
|
||
throw new Error(`Secure account data not found on node ${node.ip}`) |
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.
can we add some logs here?if there is any error in response from /secure_accounts api, we lose the error message.
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 will not be used anymore. We are going to use a local config file to fetch the secure accounts
@@ -0,0 +1,32 @@ | |||
import * as fs from 'fs' |
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.
can this be written as unit test? what's the purpose of the file?
Also, filePath
is hardcoded
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.
There are multiple different unit tests to cover because of different transaction types and the receipt logs are quite large. I thought this was the most efficient way to test out the function by fetching the receipt logs from the archiver. Testing is still incomplete, QA help is needed.
FilePath was just an example. It can be modified to anything you like. I shall keep it generic and add a disclaimer that this needs to be modified.
fix: add extractKeyFromTx function
chore : formatting fixes fix : add correct shardus-net branch
…unction to handle legacy and access list transactions
5936793
to
4fd2638
Compare
540be76
to
ee30fe4
Compare
Linear : https://linear.app/shm/issue/SEC-526/archiver-is-not-checking-list-of-accounts-belonging-to-actual-accounts