forked from privacy-scaling-explorations/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: BeginTx and EndTx support taiko's 1559 #18
Closed
johntaiko
wants to merge
27
commits into
smtmfft:eip-1559-base-dev
from
johntaiko:feat/evm_circuit_1559
Closed
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4da9a36
feat: BeginTx and EndTx support taiko's 1559
johntaiko a7d04c3
chore: update gitignore
johntaiko 9485602
chore: mark TODO
johntaiko 5c23399
feat: support effective gas price
johntaiko 07b6c22
docs: solve TODO
johntaiko 9752cdb
feat: mock with 1559 support and anchor support
johntaiko c973c78
fix: add l2 contract address into mock data
johntaiko 61798cd
feat: use taiko-geth for evm execution
johntaiko d8800ab
fix: duplicate symbol
johntaiko 5e9573c
fix: use taiko-geth
johntaiko 4bc10f8
fix: anchor without updating balance
johntaiko 68052dc
fix: update treasury with base_fee
johntaiko 182c5e5
fix: use anchor flag in context
johntaiko 03c2047
feat: treat anchor specially
johntaiko aff5000
feat: treat anchor's gas_price as zero
johntaiko 917d836
fix: testcases
johntaiko ebe34f7
Update zkevm-circuits/src/evm_circuit/execution/end_tx.rs
johntaiko 848f896
Update zkevm-circuits/src/evm_circuit/execution/end_tx.rs
johntaiko 42e25ae
Update zkevm-circuits/src/evm_circuit/execution/end_tx.rs
johntaiko 4c208e6
fix: comments in pr
johntaiko 993d6da
chore: add FIXME
johntaiko 740e655
fix: mock tx's signature with eip-1559
johntaiko 9b64614
fix: increase the step hight instead of width
johntaiko 8c33dc1
feat: add treasury account in the block table
johntaiko 11cdc1b
fix: taiko-mock's feature
johntaiko c6243e0
fix: need lookup the treasury
johntaiko 7175f7e
chore: remove TODO, support 1559 now
johntaiko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,8 @@ | |
.vscode | ||
.idea | ||
/generated | ||
*.srs | ||
*.log | ||
*.json | ||
*.yul | ||
*.sol |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,10 +309,11 @@ impl<'a> CircuitInputStateRef<'a> { | |
&& (matches!(rw, RW::READ) || (op.value_prev.is_zero() && op.value.is_zero()))) | ||
&& account.is_empty() | ||
{ | ||
panic!( | ||
"RWTable Account field {:?} lookup to non-existing account rwc: {}, op: {:?}", | ||
rw, self.block_ctx.rwc.0, op | ||
); | ||
|
||
// panic!( | ||
// "RWTable Account field {:?} lookup to non-existing account rwc: {}, op: {:?}", | ||
// rw, self.block_ctx.rwc.0, op | ||
// ); | ||
} | ||
// -- sanity check end -- | ||
// Perform the write to the account in the StateDB | ||
|
@@ -474,29 +475,21 @@ impl<'a> CircuitInputStateRef<'a> { | |
must_create: bool, | ||
value: Word, | ||
fee: Option<Word>, | ||
is_anchor_tx: bool, | ||
) -> Result<(), Error> { | ||
let (found, sender_account) = self.sdb.get_account(&sender); | ||
if !found { | ||
return Err(Error::AccountNotFound(sender)); | ||
} | ||
let mut sender_balance_prev = sender_account.balance; | ||
if !is_anchor_tx { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use zero value fee instead of a flag |
||
debug_assert!( | ||
sender_account.balance >= value + fee.unwrap_or_default(), | ||
"invalid amount balance {:?} value {:?} fee {:?}", | ||
sender_balance_prev, | ||
value, | ||
fee | ||
); | ||
} | ||
debug_assert!( | ||
sender_account.balance >= value + fee.unwrap_or_default(), | ||
"invalid amount balance {:?} value {:?} fee {:?}", | ||
sender_balance_prev, | ||
value, | ||
fee | ||
); | ||
if let Some(fee) = fee { | ||
let sender_balance = if is_anchor_tx { | ||
// anchor tx doesn't need fee | ||
sender_balance_prev | ||
} else { | ||
sender_balance_prev - fee | ||
}; | ||
let sender_balance = sender_balance_prev - fee; | ||
log::trace!( | ||
"sender balance update with fee (not reversible): {:?} {:?}->{:?}", | ||
sender, | ||
|
@@ -583,7 +576,6 @@ impl<'a> CircuitInputStateRef<'a> { | |
must_create, | ||
value, | ||
None, | ||
false, | ||
) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just marking it so it's not forgotten to be uncommented
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.
Now, we add zero value to an empty coinbase with anchor transaction. So maybe I need to add a flag to distinguish between anchor and others
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 believe this is still something that need to be fixed in general, also on the main PSE branch, so okay for now.