-
Notifications
You must be signed in to change notification settings - Fork 781
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
develop: small fixes #1924
develop: small fixes #1924
Conversation
…y, make timestamp optional instead of `| null`
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
…turn the eth protocol versions in admin_nodeInfo, so this is safely removable)
// Throw on chain or hardfork options removed in latest major release to | ||
// prevent implicit chain setup on a wrong chain | ||
if ('chain' in opts || 'hardfork' in opts) { | ||
throw new Error('Chain/hardfork options are not allowed any more on initialization') | ||
} |
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 removed this since it would be two major releases ago for develop, which I think is far enough to remove the legacy check, and TypeScript should guard downstream users against these options being used.
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 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, all fine! 🙂 👍
@@ -22,7 +22,7 @@ import EEI from './eei' | |||
import { ERROR, VmError } from '../exceptions' | |||
import { default as Interpreter, InterpreterOpts, RunState } from './interpreter' | |||
import Message, { MessageWithTo } from './message' | |||
import * as eof from './opcodes/eof' | |||
import EOF from './eof' |
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.
Ah, yes, that's better. I was actually me who introduced the structure if I remember correctly.
@@ -73,7 +70,7 @@ export class ENR { | |||
obj.secp256k1 | |||
) | |||
|
|||
assert(isVerified, 'Unable to verify ENR signature') | |||
if (!isVerified) throw new Error('Unable to verify ENR signature') |
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.
Ah, also nice here.
@@ -371,7 +371,7 @@ async function startClient(config: Config, customGenesisState?: GenesisState) { | |||
validateBlocks: true, | |||
validateConsensus, | |||
}) | |||
setCommonForkHashes(config.chainCommon, blockchain.genesisBlock().hash()) | |||
setCommonForkHashes(config.chainCommon, blockchain.genesisBlock.hash()) |
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, also nicer. 🙂
// Throw on chain or hardfork options removed in latest major release to | ||
// prevent implicit chain setup on a wrong chain | ||
if ('chain' in opts || 'hardfork' in opts) { | ||
throw new Error('Chain/hardfork options are not allowed any more on initialization') | ||
} |
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.
👍
* simplify setting blockchan genesis parameters for future extensibility, make timestamp optional instead of `| null` * move EOF one folder up, export default rather than wildcard import * remove `assert` usage from vm/precompiles, devp2p * eof: reinstate individual imports * make genesisBlock a property and add a separate createGenesisBlock method * fix mock, remove commented out code (double checked, geth does not return the eth protocol versions in admin_nodeInfo, so this is safely removable) * remove old chain/hardfork check * simplify errors, use increment operator, use for..of rather than forEach
* simplify setting blockchan genesis parameters for future extensibility, make timestamp optional instead of `| null` * move EOF one folder up, export default rather than wildcard import * remove `assert` usage from vm/precompiles, devp2p * eof: reinstate individual imports * make genesisBlock a property and add a separate createGenesisBlock method * fix mock, remove commented out code (double checked, geth does not return the eth protocol versions in admin_nodeInfo, so this is safely removable) * remove old chain/hardfork check * simplify errors, use increment operator, use for..of rather than forEach
This PR:
timestamp
optional instead of| null
to satisfy BlockHeader type constraints.EOF
file one folder up (couldn't find a reason it needed to be invm/opcodes
), export default rather than wildcard importassert
usages from evm/precompiles, devp2passert
usage left across the monorepo, woo!)