Skip to content

Spec for opcode EXTCODESIZE#53

Closed
silathdiir wants to merge 1 commit into
masterfrom
feat/opcode-extcodesize
Closed

Spec for opcode EXTCODESIZE#53
silathdiir wants to merge 1 commit into
masterfrom
feat/opcode-extcodesize

Conversation

@silathdiir
Copy link
Copy Markdown

Related upstream issue privacy-ethereum#327

It is similar as EXTCODEHASH and BALANCE (used exists witness value).

@silathdiir silathdiir requested a review from DreamWuGit December 5, 2022 01:34
# If witness value `exists == 1`, lookup both account `code_hash` and
# `code_size` (has one more lookup). Otherwise lookup account
# non-existing proof.
rw_counter=Transition.delta(7 + exists),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems rw_counter is incorrect, it doesn't count bytecode lookups in .

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete wrong count of bytecode lookup for rw_counter. Thanks a lot 🙏

Comment thread specs/opcode/3bEXTCODESIZE.md Outdated
- gas:
- the accessed `address` is warm: WARM_STORAGE_READ_COST
- the accessed `address` is cold: COLD_ACCOUNT_ACCESS_COST
3. Lookups: 8 bus-mapping lookups if account exists otherwise 7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always 7 buss mapping lookup .

Comment thread tests/evm/test_extcodesize.py Outdated
rand_address(),
rand_bytes(100),
rand_range(2),
rand_range(2) == 0,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rand_range(2) generates 0 or 1 ? if so, do not need check ==0

Comment thread tests/evm/test_extcodesize.py Outdated
tx_id = 1
call_id = 1

# 7 + 1 reversible operation (the account access list write)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can only consider successful state if fail , we will handle it in error circuit

@silathdiir silathdiir force-pushed the feat/opcode-extcodesize branch from cb6ab2e to 8f1cb9f Compare December 14, 2022 09:09
@silathdiir silathdiir force-pushed the feat/opcode-extcodesize branch from 3a0b4ee to b4e9073 Compare December 14, 2022 09:13
@silathdiir
Copy link
Copy Markdown
Author

Thanks dream's code review. Moved to upstream privacy-ethereum#341

@silathdiir silathdiir closed this Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants