Skip to content

Commit

Permalink
AA-497 validate-7702-state-override (#246)
Browse files Browse the repository at this point in the history
* AA-497-validate-7702-state-override

simulate state override

* update github actions
  • Loading branch information
drortirosh authored Feb 13, 2025
1 parent 15d1814 commit fa411b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '18'
- uses: actions/checkout@v1
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
Expand All @@ -31,11 +31,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '18'
- uses: actions/checkout@v1
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
Expand Down
5 changes: 2 additions & 3 deletions packages/validation-manager/src/ValidationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,12 @@ export class ValidationManager implements IValidationManager {
continue
}
const currentDelegateeCode = await this.provider.getCode(authSigner)
const newDelegateeCode = await this.provider.getCode(authorization.address)
// TODO should be: hexConcat(['0xef0100', authorization.address])
const newDelegateeCode = '0xef0100' + authorization.address.slice(2)
const noCurrentDelegation = currentDelegateeCode.length <= 2
// TODO: do not send such authorizations to 'handleOps' as it is a waste of gas
const changeDelegation = newDelegateeCode !== currentDelegateeCode
if (noCurrentDelegation || changeDelegation) {
console.log('Adding state override:', { address: authSigner, code: newDelegateeCode.slice(0, 20) })
debug('Adding 7702 state override:', { address: authSigner, code: newDelegateeCode })
stateOverride[authSigner] = {
code: newDelegateeCode
}
Expand Down

0 comments on commit fa411b7

Please sign in to comment.