-
Notifications
You must be signed in to change notification settings - Fork 94
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
Schedule Transactions #48
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ef18394
A tx can schedule other txes
rachel-bousfield 93e004a
gas estimation for scheduled txes
rachel-bousfield 2ddf636
address tsahi's comments
rachel-bousfield 4e008ec
Merge branch 'master' into schedule-txes
rachel-bousfield 739a0a2
return execution results rather than modifying receipts
rachel-bousfield a329ca6
add disclaimer for TransactArgsFromArbitrumTx
rachel-bousfield 2a9842d
move scheduling to DoCall()
rachel-bousfield 05d885f
Merge branch 'master' into schedule-txes
rachel-bousfield cdcb95b
cancel evm
rachel-bousfield 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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2021 The go-ethereum Authors | ||
// This file is part of the go-ethereum library. | ||
// | ||
// The go-ethereum library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The go-ethereum library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package ethapi | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common/hexutil" | ||
"github.com/ethereum/go-ethereum/core/types" | ||
) | ||
|
||
func TransactArgsFromArbitrumTx(tx *types.Transaction) (TransactionArgs, error) { | ||
msg, err := tx.AsMessage(types.NewArbitrumSigner(nil), tx.GasPrice()) | ||
rachel-bousfield marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if err != nil { | ||
return TransactionArgs{}, err | ||
} | ||
from := msg.From() | ||
gas := hexutil.Uint64(msg.Gas()) | ||
nonce := hexutil.Uint64(msg.Nonce()) | ||
input := hexutil.Bytes(tx.Data()) | ||
accessList := tx.AccessList() | ||
return TransactionArgs{ | ||
From: &from, | ||
To: msg.To(), | ||
Gas: &gas, | ||
MaxFeePerGas: (*hexutil.Big)(msg.GasFeeCap()), | ||
MaxPriorityFeePerGas: (*hexutil.Big)(msg.GasTipCap()), | ||
Value: (*hexutil.Big)(msg.Value()), | ||
Nonce: &nonce, | ||
Input: &input, | ||
AccessList: &accessList, | ||
ChainID: (*hexutil.Big)(tx.ChainId()), | ||
}, nil | ||
} |
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
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.
Maybe add redeem fields to Reciept instead of adding a return parameter? With "omitempty" they won't affect any transaction that's not a redeem. For those that do have a redeem it shouldn't be noticed by tools that don't understand the field, and might help those that are aware of the field.. (need to ask Fred)
If not - I'd say it's better to return ExecutionResult than Transaction. Seems less tailored and more flexible.
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.
Nice idea, that reduced the diff :)
I spoke to Fred and he said we've already added fields before, so it'll work with tooling.