-
Notifications
You must be signed in to change notification settings - Fork 219
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
AA-381: Create a "pull bundle" block building mode and a 'getRip7560Bundle' method #214
Conversation
…create-getRip7560Bundle-api
} | ||
|
||
// TODO: deduplicate! | ||
async handleRpcPrivate (reqItem: any): Promise<any> { |
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 don't understand this private/public distinction then - They just sit on different ports, but there are no restrictions on who can call the "private" api. Are we only planning to block requests on the "devops" side and not in code?
if so, shouldn't we just name it "blockBuilderRpcHandler" and "clientRpcHandler" since there is not private/public distinction in code? we basically rely on the cloud configuration to make sense of these names
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 can rename it but I think in the future we may end up creating other use cases for an API that is only available "internally".
I think as long as it is trivial to prevent access to the "private" API with i.e. basic docker configuration there is no point in writing any access control code.
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 don't understand why modify all existing support: we're adding a new express and handler for the (single) private API.
@@ -1,6 +1,7 @@ | |||
{ | |||
"gasFactor": "1", | |||
"port": "3000", | |||
"publicApiPort": "3000", |
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'd leave it as "port", and add a new "privateApiPort"
} | ||
|
||
// TODO: deduplicate! | ||
async handleRpcPrivate (reqItem: any): Promise<any> { |
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 don't understand why modify all existing support: we're adding a new express and handler for the (single) private API.
@@ -193,7 +198,11 @@ export class BundleManager { | |||
} | |||
} | |||
|
|||
async createBundle (): Promise<[OperationBase[], StorageMap]> { | |||
async createBundle ( | |||
minBaseFee: BigNumberish, |
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.
maybe make param optional, and missing param means "unlimited"
e.g.
baseFee = minBaseFee==null ? 0 : BigNumber.from(minBaseFee)
maxSize = maxBundleSize==null ? MAXINT : BigNumber.from(maxBundleSize).toNumber()
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.
All params are now optional, but '0' still means 'no limit', right?
@@ -290,6 +309,20 @@ export class BundleManager { | |||
} | |||
mergeStorageMap(storageMap, validationResult.storageMap) | |||
|
|||
const userOpGas = | |||
BigNumber |
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 value is useful. I thnk we should add it to "entry"
@@ -94,4 +125,15 @@ export class BundleManagerRIP7560 extends BundleManager implements IBundleManage | |||
async getPaymasterBalance (paymaster: string): Promise<BigNumber> { | |||
return await this.provider.getBalance(paymaster) | |||
} | |||
|
|||
private computeBundleHash (userOps: OperationBase[]): string { |
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 is a hash for a new entity that doesn't go on-chain. is it not needed
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.
Why not? What should we use as a bundle identifier instead? I think we need a way to identify a bundler, as I currently use eth_getRip7560BundleStatus
to check if it was included, I think.
packages/bundler/src/runBundler.ts
Outdated
.option('--config <string>', 'path to config file', CONFIG_FILE_NAME) | ||
.option('--auto', 'automatic bundling (bypass config.autoBundleMempoolSize)', false) | ||
.option('--unsafe', 'UNSAFE mode: no storage or opcode checks (safe mode requires geth)') | ||
.option('--debugRpc', 'enable debug rpc methods (auto-enabled for test node') | ||
.option('--conditionalRpc', 'Use eth_sendRawTransactionConditional RPC)') | ||
.option('--show-stack-traces', 'Show stack traces.') | ||
.option('--createMnemonic <file>', 'create the mnemonic file') | ||
.option('--useRip7560Mode', 'Use this bundler for RIP-7560 node instead of ERC-4337 (experimental).') | ||
.option('--useRip7560Mode <string>', 'Use this bundler for RIP-7560 node instead of ERC-4337 (experimental).') |
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.
our bundler already have "--dev" mode.
the userRip7560Mode should stay as boolean. push mode should be triggered by "--dev"
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.
Why?
Co-authored-by: Dror Tirosh <dror.tirosh@gmail.com>
* Add parameter and send 1 wei transaction in 'sendBundle' * Upd * Fix lint
@drortirosh I also created an issue to migrate to some official jsonrpc library: |
async sendBundle (userOps: OperationBase[], _beneficiary: string, _storageMap: StorageMap): Promise<any> { | ||
if (this.useRip7560Mode === 'PULL') { |
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.
why does it silently return ? either do something, or (more likely) return an error, since sendBundle is not allowed in pull mode.
} | ||
|
||
async _preflightCheck (): Promise<void> { | ||
if (this.config.useRip7560Mode) { | ||
if (this.config.rip7560) { |
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.
probably check the geth node supports eip7560...
(agressive wait, as ethers "wait()" is very slow...
No description provided.