Merge branch 'master' into patch-1

This commit is contained in:
Péter Garamvölgyi 2025-07-10 08:30:20 +02:00
commit aa627188b9
No known key found for this signature in database
GPG key ID: 7FC8D069F7199070
107 changed files with 7565 additions and 810 deletions

View file

@ -4,6 +4,7 @@ on:
- "master"
tags:
- "v*"
workflow_dispatch:
jobs:
linux-intel:
@ -121,6 +122,37 @@ jobs:
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
windows:
name: Windows Build
runs-on: "win-11"
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
cache: false
# Note: gcc.exe only works properly if the corresponding bin/ directory is
# contained in PATH.
- name: "Build (amd64)"
shell: cmd
run: |
set PATH=%GETH_MINGW%\bin;%PATH%
go run build/ci.go install -dlgo -arch amd64 -cc %GETH_MINGW%\bin\gcc.exe
env:
GETH_MINGW: 'C:\msys64\mingw64'
- name: "Build (386)"
shell: cmd
run: |
set PATH=%GETH_MINGW%\bin;%PATH%
go run build/ci.go install -dlgo -arch 386 -cc %GETH_MINGW%\bin\gcc.exe
env:
GETH_MINGW: 'C:\msys64\mingw32'
docker:
name: Docker Image
runs-on: ubuntu-latest

View file

@ -1,18 +1,20 @@
name: i386 linux tests
on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: self-hosted
runs-on: self-hosted-ghr
steps:
- uses: actions/checkout@v4
with:
submodules: false
# Cache build tools to avoid downloading them each time
- uses: actions/cache@v4
@ -23,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.0
go-version: 1.24
cache: false
- name: Run linters
@ -32,17 +34,25 @@ jobs:
go run build/ci.go check_generate
go run build/ci.go check_baddeps
build:
runs-on: self-hosted
test:
name: Test
needs: lint
runs-on: self-hosted-ghr
strategy:
matrix:
go:
- '1.24'
- '1.23'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.0
go-version: ${{ matrix.go }}
cache: false
- name: Run tests
run: go test -short ./...
env:
GOOS: linux
GOARCH: 386
run: go test ./...

View file

@ -281,7 +281,7 @@ func TestBindingV2ConvertedV1Tests(t *testing.T) {
}
// Set this environment variable to regenerate the test outputs.
if os.Getenv("WRITE_TEST_FILES") != "" {
if err := os.WriteFile((fname), []byte(have), 0666); err != nil {
if err := os.WriteFile(fname, []byte(have), 0666); err != nil {
t.Fatalf("err writing expected output to file: %v\n", err)
}
}

View file

@ -90,7 +90,8 @@ var (
{{range .Calls}}
// Pack{{.Normalized.Name}} is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x{{printf "%x" .Original.ID}}.
// the contract method with ID 0x{{printf "%x" .Original.ID}}. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: {{.Original.String}}
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Pack{{.Normalized.Name}}({{range .Normalized.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) []byte {
@ -101,6 +102,15 @@ var (
return enc
}
// TryPack{{.Normalized.Name}} is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x{{printf "%x" .Original.ID}}. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: {{.Original.String}}
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) TryPack{{.Normalized.Name}}({{range .Normalized.Inputs}} {{.Name}} {{bindtype .Type $structs}}, {{end}}) ([]byte, error) {
return {{ decapitalise $contract.Type}}.abi.Pack("{{.Original.Name}}" {{range .Normalized.Inputs}}, {{.Name}}{{end}})
}
{{/* Unpack method is needed only when there are return args */}}
{{if .Normalized.Outputs }}
{{ if .Structured }}
@ -133,8 +143,7 @@ var (
outstruct.{{capitalise .Name}} = *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
{{- end }}
{{- end }}
return *outstruct, err
{{else}}
return *outstruct, nil{{else}}
if err != nil {
return {{range $i, $_ := .Normalized.Outputs}}{{if ispointertype .Type}}new({{underlyingbindtype .Type }}), {{else}}*new({{bindtype .Type $structs}}), {{end}}{{end}} err
}
@ -145,7 +154,7 @@ var (
out{{$i}} := *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
{{- end }}
{{- end}}
return {{range $i, $t := .Normalized.Outputs}}out{{$i}}, {{end}} err
return {{range $i, $t := .Normalized.Outputs}}out{{$i}}, {{end}} nil
{{- end}}
}
{{end}}

View file

@ -52,7 +52,8 @@ func (c *CallbackParam) Instance(backend bind.ContractBackend, addr common.Addre
}
// PackTest is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd7a5aba2.
// the contract method with ID 0xd7a5aba2. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function test(function callback) returns()
func (callbackParam *CallbackParam) PackTest(callback [24]byte) []byte {
@ -62,3 +63,12 @@ func (callbackParam *CallbackParam) PackTest(callback [24]byte) []byte {
}
return enc
}
// TryPackTest is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd7a5aba2. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function test(function callback) returns()
func (callbackParam *CallbackParam) TryPackTest(callback [24]byte) ([]byte, error) {
return callbackParam.abi.Pack("test", callback)
}

View file

@ -64,7 +64,8 @@ func (crowdsale *Crowdsale) PackConstructor(ifSuccessfulSendTo common.Address, f
}
// PackAmountRaised is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x7b3e5e7b.
// the contract method with ID 0x7b3e5e7b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function amountRaised() returns(uint256)
func (crowdsale *Crowdsale) PackAmountRaised() []byte {
@ -75,6 +76,15 @@ func (crowdsale *Crowdsale) PackAmountRaised() []byte {
return enc
}
// TryPackAmountRaised is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x7b3e5e7b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function amountRaised() returns(uint256)
func (crowdsale *Crowdsale) TryPackAmountRaised() ([]byte, error) {
return crowdsale.abi.Pack("amountRaised")
}
// UnpackAmountRaised is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x7b3e5e7b.
//
@ -85,11 +95,12 @@ func (crowdsale *Crowdsale) UnpackAmountRaised(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackBeneficiary is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x38af3eed.
// the contract method with ID 0x38af3eed. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function beneficiary() returns(address)
func (crowdsale *Crowdsale) PackBeneficiary() []byte {
@ -100,6 +111,15 @@ func (crowdsale *Crowdsale) PackBeneficiary() []byte {
return enc
}
// TryPackBeneficiary is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x38af3eed. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function beneficiary() returns(address)
func (crowdsale *Crowdsale) TryPackBeneficiary() ([]byte, error) {
return crowdsale.abi.Pack("beneficiary")
}
// UnpackBeneficiary is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x38af3eed.
//
@ -110,11 +130,12 @@ func (crowdsale *Crowdsale) UnpackBeneficiary(data []byte) (common.Address, erro
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
return out0, nil
}
// PackCheckGoalReached is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x01cb3b20.
// the contract method with ID 0x01cb3b20. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function checkGoalReached() returns()
func (crowdsale *Crowdsale) PackCheckGoalReached() []byte {
@ -125,8 +146,18 @@ func (crowdsale *Crowdsale) PackCheckGoalReached() []byte {
return enc
}
// TryPackCheckGoalReached is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x01cb3b20. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function checkGoalReached() returns()
func (crowdsale *Crowdsale) TryPackCheckGoalReached() ([]byte, error) {
return crowdsale.abi.Pack("checkGoalReached")
}
// PackDeadline is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x29dcb0cf.
// the contract method with ID 0x29dcb0cf. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function deadline() returns(uint256)
func (crowdsale *Crowdsale) PackDeadline() []byte {
@ -137,6 +168,15 @@ func (crowdsale *Crowdsale) PackDeadline() []byte {
return enc
}
// TryPackDeadline is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x29dcb0cf. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function deadline() returns(uint256)
func (crowdsale *Crowdsale) TryPackDeadline() ([]byte, error) {
return crowdsale.abi.Pack("deadline")
}
// UnpackDeadline is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x29dcb0cf.
//
@ -147,11 +187,12 @@ func (crowdsale *Crowdsale) UnpackDeadline(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackFunders is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xdc0d3dff.
// the contract method with ID 0xdc0d3dff. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function funders(uint256 ) returns(address addr, uint256 amount)
func (crowdsale *Crowdsale) PackFunders(arg0 *big.Int) []byte {
@ -162,6 +203,15 @@ func (crowdsale *Crowdsale) PackFunders(arg0 *big.Int) []byte {
return enc
}
// TryPackFunders is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xdc0d3dff. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function funders(uint256 ) returns(address addr, uint256 amount)
func (crowdsale *Crowdsale) TryPackFunders(arg0 *big.Int) ([]byte, error) {
return crowdsale.abi.Pack("funders", arg0)
}
// FundersOutput serves as a container for the return parameters of contract
// method Funders.
type FundersOutput struct {
@ -181,12 +231,12 @@ func (crowdsale *Crowdsale) UnpackFunders(data []byte) (FundersOutput, error) {
}
outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackFundingGoal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x7a3a0e84.
// the contract method with ID 0x7a3a0e84. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function fundingGoal() returns(uint256)
func (crowdsale *Crowdsale) PackFundingGoal() []byte {
@ -197,6 +247,15 @@ func (crowdsale *Crowdsale) PackFundingGoal() []byte {
return enc
}
// TryPackFundingGoal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x7a3a0e84. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function fundingGoal() returns(uint256)
func (crowdsale *Crowdsale) TryPackFundingGoal() ([]byte, error) {
return crowdsale.abi.Pack("fundingGoal")
}
// UnpackFundingGoal is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x7a3a0e84.
//
@ -207,11 +266,12 @@ func (crowdsale *Crowdsale) UnpackFundingGoal(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackPrice is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xa035b1fe.
// the contract method with ID 0xa035b1fe. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function price() returns(uint256)
func (crowdsale *Crowdsale) PackPrice() []byte {
@ -222,6 +282,15 @@ func (crowdsale *Crowdsale) PackPrice() []byte {
return enc
}
// TryPackPrice is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xa035b1fe. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function price() returns(uint256)
func (crowdsale *Crowdsale) TryPackPrice() ([]byte, error) {
return crowdsale.abi.Pack("price")
}
// UnpackPrice is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xa035b1fe.
//
@ -232,11 +301,12 @@ func (crowdsale *Crowdsale) UnpackPrice(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackTokenReward is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6e66f6e9.
// the contract method with ID 0x6e66f6e9. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function tokenReward() returns(address)
func (crowdsale *Crowdsale) PackTokenReward() []byte {
@ -247,6 +317,15 @@ func (crowdsale *Crowdsale) PackTokenReward() []byte {
return enc
}
// TryPackTokenReward is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6e66f6e9. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function tokenReward() returns(address)
func (crowdsale *Crowdsale) TryPackTokenReward() ([]byte, error) {
return crowdsale.abi.Pack("tokenReward")
}
// UnpackTokenReward is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x6e66f6e9.
//
@ -257,7 +336,7 @@ func (crowdsale *Crowdsale) UnpackTokenReward(data []byte) (common.Address, erro
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
return out0, nil
}
// CrowdsaleFundTransfer represents a FundTransfer event raised by the Crowdsale contract.

View file

@ -64,7 +64,8 @@ func (dAO *DAO) PackConstructor(minimumQuorumForProposals *big.Int, minutesForDe
}
// PackChangeMembership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9644fcbd.
// the contract method with ID 0x9644fcbd. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
func (dAO *DAO) PackChangeMembership(targetMember common.Address, canVote bool, memberName string) []byte {
@ -75,8 +76,18 @@ func (dAO *DAO) PackChangeMembership(targetMember common.Address, canVote bool,
return enc
}
// TryPackChangeMembership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9644fcbd. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function changeMembership(address targetMember, bool canVote, string memberName) returns()
func (dAO *DAO) TryPackChangeMembership(targetMember common.Address, canVote bool, memberName string) ([]byte, error) {
return dAO.abi.Pack("changeMembership", targetMember, canVote, memberName)
}
// PackChangeVotingRules is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbcca1fd3.
// the contract method with ID 0xbcca1fd3. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
func (dAO *DAO) PackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) []byte {
@ -87,8 +98,18 @@ func (dAO *DAO) PackChangeVotingRules(minimumQuorumForProposals *big.Int, minute
return enc
}
// TryPackChangeVotingRules is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbcca1fd3. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function changeVotingRules(uint256 minimumQuorumForProposals, uint256 minutesForDebate, int256 marginOfVotesForMajority) returns()
func (dAO *DAO) TryPackChangeVotingRules(minimumQuorumForProposals *big.Int, minutesForDebate *big.Int, marginOfVotesForMajority *big.Int) ([]byte, error) {
return dAO.abi.Pack("changeVotingRules", minimumQuorumForProposals, minutesForDebate, marginOfVotesForMajority)
}
// PackCheckProposalCode is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xeceb2945.
// the contract method with ID 0xeceb2945. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
func (dAO *DAO) PackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) []byte {
@ -99,6 +120,15 @@ func (dAO *DAO) PackCheckProposalCode(proposalNumber *big.Int, beneficiary commo
return enc
}
// TryPackCheckProposalCode is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xeceb2945. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function checkProposalCode(uint256 proposalNumber, address beneficiary, uint256 etherAmount, bytes transactionBytecode) returns(bool codeChecksOut)
func (dAO *DAO) TryPackCheckProposalCode(proposalNumber *big.Int, beneficiary common.Address, etherAmount *big.Int, transactionBytecode []byte) ([]byte, error) {
return dAO.abi.Pack("checkProposalCode", proposalNumber, beneficiary, etherAmount, transactionBytecode)
}
// UnpackCheckProposalCode is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xeceb2945.
//
@ -109,11 +139,12 @@ func (dAO *DAO) UnpackCheckProposalCode(data []byte) (bool, error) {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
return out0, nil
}
// PackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x69bd3436.
// the contract method with ID 0x69bd3436. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function debatingPeriodInMinutes() returns(uint256)
func (dAO *DAO) PackDebatingPeriodInMinutes() []byte {
@ -124,6 +155,15 @@ func (dAO *DAO) PackDebatingPeriodInMinutes() []byte {
return enc
}
// TryPackDebatingPeriodInMinutes is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x69bd3436. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function debatingPeriodInMinutes() returns(uint256)
func (dAO *DAO) TryPackDebatingPeriodInMinutes() ([]byte, error) {
return dAO.abi.Pack("debatingPeriodInMinutes")
}
// UnpackDebatingPeriodInMinutes is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x69bd3436.
//
@ -134,11 +174,12 @@ func (dAO *DAO) UnpackDebatingPeriodInMinutes(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackExecuteProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x237e9492.
// the contract method with ID 0x237e9492. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
func (dAO *DAO) PackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) []byte {
@ -149,6 +190,15 @@ func (dAO *DAO) PackExecuteProposal(proposalNumber *big.Int, transactionBytecode
return enc
}
// TryPackExecuteProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x237e9492. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function executeProposal(uint256 proposalNumber, bytes transactionBytecode) returns(int256 result)
func (dAO *DAO) TryPackExecuteProposal(proposalNumber *big.Int, transactionBytecode []byte) ([]byte, error) {
return dAO.abi.Pack("executeProposal", proposalNumber, transactionBytecode)
}
// UnpackExecuteProposal is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x237e9492.
//
@ -159,11 +209,12 @@ func (dAO *DAO) UnpackExecuteProposal(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackMajorityMargin is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xaa02a90f.
// the contract method with ID 0xaa02a90f. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function majorityMargin() returns(int256)
func (dAO *DAO) PackMajorityMargin() []byte {
@ -174,6 +225,15 @@ func (dAO *DAO) PackMajorityMargin() []byte {
return enc
}
// TryPackMajorityMargin is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xaa02a90f. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function majorityMargin() returns(int256)
func (dAO *DAO) TryPackMajorityMargin() ([]byte, error) {
return dAO.abi.Pack("majorityMargin")
}
// UnpackMajorityMargin is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xaa02a90f.
//
@ -184,11 +244,12 @@ func (dAO *DAO) UnpackMajorityMargin(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackMemberId is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x39106821.
// the contract method with ID 0x39106821. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function memberId(address ) returns(uint256)
func (dAO *DAO) PackMemberId(arg0 common.Address) []byte {
@ -199,6 +260,15 @@ func (dAO *DAO) PackMemberId(arg0 common.Address) []byte {
return enc
}
// TryPackMemberId is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x39106821. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function memberId(address ) returns(uint256)
func (dAO *DAO) TryPackMemberId(arg0 common.Address) ([]byte, error) {
return dAO.abi.Pack("memberId", arg0)
}
// UnpackMemberId is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x39106821.
//
@ -209,11 +279,12 @@ func (dAO *DAO) UnpackMemberId(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackMembers is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x5daf08ca.
// the contract method with ID 0x5daf08ca. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
func (dAO *DAO) PackMembers(arg0 *big.Int) []byte {
@ -224,6 +295,15 @@ func (dAO *DAO) PackMembers(arg0 *big.Int) []byte {
return enc
}
// TryPackMembers is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x5daf08ca. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function members(uint256 ) returns(address member, bool canVote, string name, uint256 memberSince)
func (dAO *DAO) TryPackMembers(arg0 *big.Int) ([]byte, error) {
return dAO.abi.Pack("members", arg0)
}
// MembersOutput serves as a container for the return parameters of contract
// method Members.
type MembersOutput struct {
@ -247,12 +327,12 @@ func (dAO *DAO) UnpackMembers(data []byte) (MembersOutput, error) {
outstruct.CanVote = *abi.ConvertType(out[1], new(bool)).(*bool)
outstruct.Name = *abi.ConvertType(out[2], new(string)).(*string)
outstruct.MemberSince = abi.ConvertType(out[3], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackMinimumQuorum is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8160f0b5.
// the contract method with ID 0x8160f0b5. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function minimumQuorum() returns(uint256)
func (dAO *DAO) PackMinimumQuorum() []byte {
@ -263,6 +343,15 @@ func (dAO *DAO) PackMinimumQuorum() []byte {
return enc
}
// TryPackMinimumQuorum is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8160f0b5. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function minimumQuorum() returns(uint256)
func (dAO *DAO) TryPackMinimumQuorum() ([]byte, error) {
return dAO.abi.Pack("minimumQuorum")
}
// UnpackMinimumQuorum is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x8160f0b5.
//
@ -273,11 +362,12 @@ func (dAO *DAO) UnpackMinimumQuorum(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackNewProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb1050da5.
// the contract method with ID 0xb1050da5. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
func (dAO *DAO) PackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) []byte {
@ -288,6 +378,15 @@ func (dAO *DAO) PackNewProposal(beneficiary common.Address, etherAmount *big.Int
return enc
}
// TryPackNewProposal is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb1050da5. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function newProposal(address beneficiary, uint256 etherAmount, string JobDescription, bytes transactionBytecode) returns(uint256 proposalID)
func (dAO *DAO) TryPackNewProposal(beneficiary common.Address, etherAmount *big.Int, jobDescription string, transactionBytecode []byte) ([]byte, error) {
return dAO.abi.Pack("newProposal", beneficiary, etherAmount, jobDescription, transactionBytecode)
}
// UnpackNewProposal is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xb1050da5.
//
@ -298,11 +397,12 @@ func (dAO *DAO) UnpackNewProposal(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackNumProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x400e3949.
// the contract method with ID 0x400e3949. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function numProposals() returns(uint256)
func (dAO *DAO) PackNumProposals() []byte {
@ -313,6 +413,15 @@ func (dAO *DAO) PackNumProposals() []byte {
return enc
}
// TryPackNumProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x400e3949. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function numProposals() returns(uint256)
func (dAO *DAO) TryPackNumProposals() ([]byte, error) {
return dAO.abi.Pack("numProposals")
}
// UnpackNumProposals is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x400e3949.
//
@ -323,11 +432,12 @@ func (dAO *DAO) UnpackNumProposals(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackOwner is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8da5cb5b.
// the contract method with ID 0x8da5cb5b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function owner() returns(address)
func (dAO *DAO) PackOwner() []byte {
@ -338,6 +448,15 @@ func (dAO *DAO) PackOwner() []byte {
return enc
}
// TryPackOwner is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8da5cb5b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function owner() returns(address)
func (dAO *DAO) TryPackOwner() ([]byte, error) {
return dAO.abi.Pack("owner")
}
// UnpackOwner is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x8da5cb5b.
//
@ -348,11 +467,12 @@ func (dAO *DAO) UnpackOwner(data []byte) (common.Address, error) {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
return out0, nil
}
// PackProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x013cf08b.
// the contract method with ID 0x013cf08b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
func (dAO *DAO) PackProposals(arg0 *big.Int) []byte {
@ -363,6 +483,15 @@ func (dAO *DAO) PackProposals(arg0 *big.Int) []byte {
return enc
}
// TryPackProposals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x013cf08b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function proposals(uint256 ) returns(address recipient, uint256 amount, string description, uint256 votingDeadline, bool executed, bool proposalPassed, uint256 numberOfVotes, int256 currentResult, bytes32 proposalHash)
func (dAO *DAO) TryPackProposals(arg0 *big.Int) ([]byte, error) {
return dAO.abi.Pack("proposals", arg0)
}
// ProposalsOutput serves as a container for the return parameters of contract
// method Proposals.
type ProposalsOutput struct {
@ -396,12 +525,12 @@ func (dAO *DAO) UnpackProposals(data []byte) (ProposalsOutput, error) {
outstruct.NumberOfVotes = abi.ConvertType(out[6], new(big.Int)).(*big.Int)
outstruct.CurrentResult = abi.ConvertType(out[7], new(big.Int)).(*big.Int)
outstruct.ProposalHash = *abi.ConvertType(out[8], new([32]byte)).(*[32]byte)
return *outstruct, err
return *outstruct, nil
}
// PackTransferOwnership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xf2fde38b.
// the contract method with ID 0xf2fde38b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (dAO *DAO) PackTransferOwnership(newOwner common.Address) []byte {
@ -412,8 +541,18 @@ func (dAO *DAO) PackTransferOwnership(newOwner common.Address) []byte {
return enc
}
// TryPackTransferOwnership is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xf2fde38b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (dAO *DAO) TryPackTransferOwnership(newOwner common.Address) ([]byte, error) {
return dAO.abi.Pack("transferOwnership", newOwner)
}
// PackVote is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd3c0715b.
// the contract method with ID 0xd3c0715b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
func (dAO *DAO) PackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) []byte {
@ -424,6 +563,15 @@ func (dAO *DAO) PackVote(proposalNumber *big.Int, supportsProposal bool, justifi
return enc
}
// TryPackVote is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd3c0715b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function vote(uint256 proposalNumber, bool supportsProposal, string justificationText) returns(uint256 voteID)
func (dAO *DAO) TryPackVote(proposalNumber *big.Int, supportsProposal bool, justificationText string) ([]byte, error) {
return dAO.abi.Pack("vote", proposalNumber, supportsProposal, justificationText)
}
// UnpackVote is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xd3c0715b.
//
@ -434,7 +582,7 @@ func (dAO *DAO) UnpackVote(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// DAOChangeOfRules represents a ChangeOfRules event raised by the DAO contract.

View file

@ -52,7 +52,8 @@ func (c *DeeplyNestedArray) Instance(backend bind.ContractBackend, addr common.A
}
// PackDeepUint64Array is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x98ed1856.
// the contract method with ID 0x98ed1856. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function deepUint64Array(uint256 , uint256 , uint256 ) view returns(uint64)
func (deeplyNestedArray *DeeplyNestedArray) PackDeepUint64Array(arg0 *big.Int, arg1 *big.Int, arg2 *big.Int) []byte {
@ -63,6 +64,15 @@ func (deeplyNestedArray *DeeplyNestedArray) PackDeepUint64Array(arg0 *big.Int, a
return enc
}
// TryPackDeepUint64Array is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x98ed1856. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function deepUint64Array(uint256 , uint256 , uint256 ) view returns(uint64)
func (deeplyNestedArray *DeeplyNestedArray) TryPackDeepUint64Array(arg0 *big.Int, arg1 *big.Int, arg2 *big.Int) ([]byte, error) {
return deeplyNestedArray.abi.Pack("deepUint64Array", arg0, arg1, arg2)
}
// UnpackDeepUint64Array is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x98ed1856.
//
@ -73,11 +83,12 @@ func (deeplyNestedArray *DeeplyNestedArray) UnpackDeepUint64Array(data []byte) (
return *new(uint64), err
}
out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
return out0, err
return out0, nil
}
// PackRetrieveDeepArray is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8ed4573a.
// the contract method with ID 0x8ed4573a. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function retrieveDeepArray() view returns(uint64[3][4][5])
func (deeplyNestedArray *DeeplyNestedArray) PackRetrieveDeepArray() []byte {
@ -88,6 +99,15 @@ func (deeplyNestedArray *DeeplyNestedArray) PackRetrieveDeepArray() []byte {
return enc
}
// TryPackRetrieveDeepArray is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x8ed4573a. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function retrieveDeepArray() view returns(uint64[3][4][5])
func (deeplyNestedArray *DeeplyNestedArray) TryPackRetrieveDeepArray() ([]byte, error) {
return deeplyNestedArray.abi.Pack("retrieveDeepArray")
}
// UnpackRetrieveDeepArray is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x8ed4573a.
//
@ -98,11 +118,12 @@ func (deeplyNestedArray *DeeplyNestedArray) UnpackRetrieveDeepArray(data []byte)
return *new([5][4][3]uint64), err
}
out0 := *abi.ConvertType(out[0], new([5][4][3]uint64)).(*[5][4][3]uint64)
return out0, err
return out0, nil
}
// PackStoreDeepUintArray is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x34424855.
// the contract method with ID 0x34424855. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function storeDeepUintArray(uint64[3][4][5] arr) returns()
func (deeplyNestedArray *DeeplyNestedArray) PackStoreDeepUintArray(arr [5][4][3]uint64) []byte {
@ -112,3 +133,12 @@ func (deeplyNestedArray *DeeplyNestedArray) PackStoreDeepUintArray(arr [5][4][3]
}
return enc
}
// TryPackStoreDeepUintArray is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x34424855. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function storeDeepUintArray(uint64[3][4][5] arr) returns()
func (deeplyNestedArray *DeeplyNestedArray) TryPackStoreDeepUintArray(arr [5][4][3]uint64) ([]byte, error) {
return deeplyNestedArray.abi.Pack("storeDeepUintArray", arr)
}

View file

@ -52,7 +52,8 @@ func (c *Getter) Instance(backend bind.ContractBackend, addr common.Address) *bi
}
// PackGetter is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x993a04b7.
// the contract method with ID 0x993a04b7. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function getter() returns(string, int256, bytes32)
func (getter *Getter) PackGetter() []byte {
@ -63,6 +64,15 @@ func (getter *Getter) PackGetter() []byte {
return enc
}
// TryPackGetter is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x993a04b7. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function getter() returns(string, int256, bytes32)
func (getter *Getter) TryPackGetter() ([]byte, error) {
return getter.abi.Pack("getter")
}
// GetterOutput serves as a container for the return parameters of contract
// method Getter.
type GetterOutput struct {
@ -84,6 +94,5 @@ func (getter *Getter) UnpackGetter(data []byte) (GetterOutput, error) {
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
outstruct.Arg2 = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
return *outstruct, err
return *outstruct, nil
}

View file

@ -52,7 +52,8 @@ func (c *IdentifierCollision) Instance(backend bind.ContractBackend, addr common
}
// PackMyVar is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x4ef1f0ad.
// the contract method with ID 0x4ef1f0ad. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function MyVar() view returns(uint256)
func (identifierCollision *IdentifierCollision) PackMyVar() []byte {
@ -63,6 +64,15 @@ func (identifierCollision *IdentifierCollision) PackMyVar() []byte {
return enc
}
// TryPackMyVar is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x4ef1f0ad. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function MyVar() view returns(uint256)
func (identifierCollision *IdentifierCollision) TryPackMyVar() ([]byte, error) {
return identifierCollision.abi.Pack("MyVar")
}
// UnpackMyVar is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x4ef1f0ad.
//
@ -73,11 +83,12 @@ func (identifierCollision *IdentifierCollision) UnpackMyVar(data []byte) (*big.I
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackPubVar is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x01ad4d87.
// the contract method with ID 0x01ad4d87. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function _myVar() view returns(uint256)
func (identifierCollision *IdentifierCollision) PackPubVar() []byte {
@ -88,6 +99,15 @@ func (identifierCollision *IdentifierCollision) PackPubVar() []byte {
return enc
}
// TryPackPubVar is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x01ad4d87. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function _myVar() view returns(uint256)
func (identifierCollision *IdentifierCollision) TryPackPubVar() ([]byte, error) {
return identifierCollision.abi.Pack("_myVar")
}
// UnpackPubVar is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x01ad4d87.
//
@ -98,5 +118,5 @@ func (identifierCollision *IdentifierCollision) UnpackPubVar(data []byte) (*big.
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}

View file

@ -51,7 +51,8 @@ func (c *InputChecker) Instance(backend bind.ContractBackend, addr common.Addres
}
// PackAnonInput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x3e708e82.
// the contract method with ID 0x3e708e82. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function anonInput(string ) returns()
func (inputChecker *InputChecker) PackAnonInput(arg0 string) []byte {
@ -62,8 +63,18 @@ func (inputChecker *InputChecker) PackAnonInput(arg0 string) []byte {
return enc
}
// TryPackAnonInput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x3e708e82. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function anonInput(string ) returns()
func (inputChecker *InputChecker) TryPackAnonInput(arg0 string) ([]byte, error) {
return inputChecker.abi.Pack("anonInput", arg0)
}
// PackAnonInputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x28160527.
// the contract method with ID 0x28160527. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function anonInputs(string , string ) returns()
func (inputChecker *InputChecker) PackAnonInputs(arg0 string, arg1 string) []byte {
@ -74,8 +85,18 @@ func (inputChecker *InputChecker) PackAnonInputs(arg0 string, arg1 string) []byt
return enc
}
// TryPackAnonInputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x28160527. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function anonInputs(string , string ) returns()
func (inputChecker *InputChecker) TryPackAnonInputs(arg0 string, arg1 string) ([]byte, error) {
return inputChecker.abi.Pack("anonInputs", arg0, arg1)
}
// PackMixedInputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xc689ebdc.
// the contract method with ID 0xc689ebdc. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function mixedInputs(string , string str) returns()
func (inputChecker *InputChecker) PackMixedInputs(arg0 string, str string) []byte {
@ -86,8 +107,18 @@ func (inputChecker *InputChecker) PackMixedInputs(arg0 string, str string) []byt
return enc
}
// TryPackMixedInputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xc689ebdc. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function mixedInputs(string , string str) returns()
func (inputChecker *InputChecker) TryPackMixedInputs(arg0 string, str string) ([]byte, error) {
return inputChecker.abi.Pack("mixedInputs", arg0, str)
}
// PackNamedInput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x0d402005.
// the contract method with ID 0x0d402005. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function namedInput(string str) returns()
func (inputChecker *InputChecker) PackNamedInput(str string) []byte {
@ -98,8 +129,18 @@ func (inputChecker *InputChecker) PackNamedInput(str string) []byte {
return enc
}
// TryPackNamedInput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x0d402005. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function namedInput(string str) returns()
func (inputChecker *InputChecker) TryPackNamedInput(str string) ([]byte, error) {
return inputChecker.abi.Pack("namedInput", str)
}
// PackNamedInputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x63c796ed.
// the contract method with ID 0x63c796ed. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function namedInputs(string str1, string str2) returns()
func (inputChecker *InputChecker) PackNamedInputs(str1 string, str2 string) []byte {
@ -110,8 +151,18 @@ func (inputChecker *InputChecker) PackNamedInputs(str1 string, str2 string) []by
return enc
}
// TryPackNamedInputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x63c796ed. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function namedInputs(string str1, string str2) returns()
func (inputChecker *InputChecker) TryPackNamedInputs(str1 string, str2 string) ([]byte, error) {
return inputChecker.abi.Pack("namedInputs", str1, str2)
}
// PackNoInput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x53539029.
// the contract method with ID 0x53539029. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function noInput() returns()
func (inputChecker *InputChecker) PackNoInput() []byte {
@ -121,3 +172,12 @@ func (inputChecker *InputChecker) PackNoInput() []byte {
}
return enc
}
// TryPackNoInput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x53539029. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function noInput() returns()
func (inputChecker *InputChecker) TryPackNoInput() ([]byte, error) {
return inputChecker.abi.Pack("noInput")
}

View file

@ -64,7 +64,8 @@ func (interactor *Interactor) PackConstructor(str string) []byte {
}
// PackDeployString is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6874e809.
// the contract method with ID 0x6874e809. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function deployString() returns(string)
func (interactor *Interactor) PackDeployString() []byte {
@ -75,6 +76,15 @@ func (interactor *Interactor) PackDeployString() []byte {
return enc
}
// TryPackDeployString is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6874e809. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function deployString() returns(string)
func (interactor *Interactor) TryPackDeployString() ([]byte, error) {
return interactor.abi.Pack("deployString")
}
// UnpackDeployString is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x6874e809.
//
@ -85,11 +95,12 @@ func (interactor *Interactor) UnpackDeployString(data []byte) (string, error) {
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
return out0, nil
}
// PackTransact is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd736c513.
// the contract method with ID 0xd736c513. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function transact(string str) returns()
func (interactor *Interactor) PackTransact(str string) []byte {
@ -100,8 +111,18 @@ func (interactor *Interactor) PackTransact(str string) []byte {
return enc
}
// TryPackTransact is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd736c513. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function transact(string str) returns()
func (interactor *Interactor) TryPackTransact(str string) ([]byte, error) {
return interactor.abi.Pack("transact", str)
}
// PackTransactString is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x0d86a0e1.
// the contract method with ID 0x0d86a0e1. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function transactString() returns(string)
func (interactor *Interactor) PackTransactString() []byte {
@ -112,6 +133,15 @@ func (interactor *Interactor) PackTransactString() []byte {
return enc
}
// TryPackTransactString is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x0d86a0e1. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function transactString() returns(string)
func (interactor *Interactor) TryPackTransactString() ([]byte, error) {
return interactor.abi.Pack("transactString")
}
// UnpackTransactString is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x0d86a0e1.
//
@ -122,5 +152,5 @@ func (interactor *Interactor) UnpackTransactString(data []byte) (string, error)
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
return out0, nil
}

View file

@ -58,7 +58,8 @@ func (c *NameConflict) Instance(backend bind.ContractBackend, addr common.Addres
}
// PackAddRequest is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xcce7b048.
// the contract method with ID 0xcce7b048. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function addRequest((bytes,bytes) req) pure returns()
func (nameConflict *NameConflict) PackAddRequest(req Oraclerequest) []byte {
@ -69,8 +70,18 @@ func (nameConflict *NameConflict) PackAddRequest(req Oraclerequest) []byte {
return enc
}
// TryPackAddRequest is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xcce7b048. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function addRequest((bytes,bytes) req) pure returns()
func (nameConflict *NameConflict) TryPackAddRequest(req Oraclerequest) ([]byte, error) {
return nameConflict.abi.Pack("addRequest", req)
}
// PackGetRequest is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xc2bb515f.
// the contract method with ID 0xc2bb515f. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function getRequest() pure returns((bytes,bytes))
func (nameConflict *NameConflict) PackGetRequest() []byte {
@ -81,6 +92,15 @@ func (nameConflict *NameConflict) PackGetRequest() []byte {
return enc
}
// TryPackGetRequest is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xc2bb515f. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function getRequest() pure returns((bytes,bytes))
func (nameConflict *NameConflict) TryPackGetRequest() ([]byte, error) {
return nameConflict.abi.Pack("getRequest")
}
// UnpackGetRequest is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xc2bb515f.
//
@ -91,7 +111,7 @@ func (nameConflict *NameConflict) UnpackGetRequest(data []byte) (Oraclerequest,
return *new(Oraclerequest), err
}
out0 := *abi.ConvertType(out[0], new(Oraclerequest)).(*Oraclerequest)
return out0, err
return out0, nil
}
// NameConflictLog represents a log event raised by the NameConflict contract.

View file

@ -52,7 +52,8 @@ func (c *NumericMethodName) Instance(backend bind.ContractBackend, addr common.A
}
// PackE1test is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xffa02795.
// the contract method with ID 0xffa02795. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function _1test() pure returns()
func (numericMethodName *NumericMethodName) PackE1test() []byte {
@ -63,8 +64,18 @@ func (numericMethodName *NumericMethodName) PackE1test() []byte {
return enc
}
// TryPackE1test is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xffa02795. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function _1test() pure returns()
func (numericMethodName *NumericMethodName) TryPackE1test() ([]byte, error) {
return numericMethodName.abi.Pack("_1test")
}
// PackE1test0 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd02767c7.
// the contract method with ID 0xd02767c7. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function __1test() pure returns()
func (numericMethodName *NumericMethodName) PackE1test0() []byte {
@ -75,8 +86,18 @@ func (numericMethodName *NumericMethodName) PackE1test0() []byte {
return enc
}
// TryPackE1test0 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd02767c7. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function __1test() pure returns()
func (numericMethodName *NumericMethodName) TryPackE1test0() ([]byte, error) {
return numericMethodName.abi.Pack("__1test")
}
// PackE2test is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9d993132.
// the contract method with ID 0x9d993132. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function __2test() pure returns()
func (numericMethodName *NumericMethodName) PackE2test() []byte {
@ -87,6 +108,15 @@ func (numericMethodName *NumericMethodName) PackE2test() []byte {
return enc
}
// TryPackE2test is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9d993132. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function __2test() pure returns()
func (numericMethodName *NumericMethodName) TryPackE2test() ([]byte, error) {
return numericMethodName.abi.Pack("__2test")
}
// NumericMethodNameE1TestEvent represents a _1TestEvent event raised by the NumericMethodName contract.
type NumericMethodNameE1TestEvent struct {
Param common.Address

View file

@ -51,7 +51,8 @@ func (c *OutputChecker) Instance(backend bind.ContractBackend, addr common.Addre
}
// PackAnonOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x008bda05.
// the contract method with ID 0x008bda05. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function anonOutput() returns(string)
func (outputChecker *OutputChecker) PackAnonOutput() []byte {
@ -62,6 +63,15 @@ func (outputChecker *OutputChecker) PackAnonOutput() []byte {
return enc
}
// TryPackAnonOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x008bda05. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function anonOutput() returns(string)
func (outputChecker *OutputChecker) TryPackAnonOutput() ([]byte, error) {
return outputChecker.abi.Pack("anonOutput")
}
// UnpackAnonOutput is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x008bda05.
//
@ -72,11 +82,12 @@ func (outputChecker *OutputChecker) UnpackAnonOutput(data []byte) (string, error
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
return out0, nil
}
// PackAnonOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x3c401115.
// the contract method with ID 0x3c401115. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function anonOutputs() returns(string, string)
func (outputChecker *OutputChecker) PackAnonOutputs() []byte {
@ -87,6 +98,15 @@ func (outputChecker *OutputChecker) PackAnonOutputs() []byte {
return enc
}
// TryPackAnonOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x3c401115. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function anonOutputs() returns(string, string)
func (outputChecker *OutputChecker) TryPackAnonOutputs() ([]byte, error) {
return outputChecker.abi.Pack("anonOutputs")
}
// AnonOutputsOutput serves as a container for the return parameters of contract
// method AnonOutputs.
type AnonOutputsOutput struct {
@ -106,12 +126,12 @@ func (outputChecker *OutputChecker) UnpackAnonOutputs(data []byte) (AnonOutputsO
}
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
outstruct.Arg1 = *abi.ConvertType(out[1], new(string)).(*string)
return *outstruct, err
return *outstruct, nil
}
// PackCollidingOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xeccbc1ee.
// the contract method with ID 0xeccbc1ee. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function collidingOutputs() returns(string str, string Str)
func (outputChecker *OutputChecker) PackCollidingOutputs() []byte {
@ -122,6 +142,15 @@ func (outputChecker *OutputChecker) PackCollidingOutputs() []byte {
return enc
}
// TryPackCollidingOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xeccbc1ee. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function collidingOutputs() returns(string str, string Str)
func (outputChecker *OutputChecker) TryPackCollidingOutputs() ([]byte, error) {
return outputChecker.abi.Pack("collidingOutputs")
}
// CollidingOutputsOutput serves as a container for the return parameters of contract
// method CollidingOutputs.
type CollidingOutputsOutput struct {
@ -141,12 +170,12 @@ func (outputChecker *OutputChecker) UnpackCollidingOutputs(data []byte) (Collidi
}
outstruct.Str = *abi.ConvertType(out[0], new(string)).(*string)
outstruct.Str0 = *abi.ConvertType(out[1], new(string)).(*string)
return *outstruct, err
return *outstruct, nil
}
// PackMixedOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x21b77b44.
// the contract method with ID 0x21b77b44. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function mixedOutputs() returns(string, string str)
func (outputChecker *OutputChecker) PackMixedOutputs() []byte {
@ -157,6 +186,15 @@ func (outputChecker *OutputChecker) PackMixedOutputs() []byte {
return enc
}
// TryPackMixedOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x21b77b44. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function mixedOutputs() returns(string, string str)
func (outputChecker *OutputChecker) TryPackMixedOutputs() ([]byte, error) {
return outputChecker.abi.Pack("mixedOutputs")
}
// MixedOutputsOutput serves as a container for the return parameters of contract
// method MixedOutputs.
type MixedOutputsOutput struct {
@ -176,12 +214,12 @@ func (outputChecker *OutputChecker) UnpackMixedOutputs(data []byte) (MixedOutput
}
outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string)
outstruct.Str = *abi.ConvertType(out[1], new(string)).(*string)
return *outstruct, err
return *outstruct, nil
}
// PackNamedOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x5e632bd5.
// the contract method with ID 0x5e632bd5. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function namedOutput() returns(string str)
func (outputChecker *OutputChecker) PackNamedOutput() []byte {
@ -192,6 +230,15 @@ func (outputChecker *OutputChecker) PackNamedOutput() []byte {
return enc
}
// TryPackNamedOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x5e632bd5. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function namedOutput() returns(string str)
func (outputChecker *OutputChecker) TryPackNamedOutput() ([]byte, error) {
return outputChecker.abi.Pack("namedOutput")
}
// UnpackNamedOutput is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x5e632bd5.
//
@ -202,11 +249,12 @@ func (outputChecker *OutputChecker) UnpackNamedOutput(data []byte) (string, erro
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
return out0, nil
}
// PackNamedOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x7970a189.
// the contract method with ID 0x7970a189. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function namedOutputs() returns(string str1, string str2)
func (outputChecker *OutputChecker) PackNamedOutputs() []byte {
@ -217,6 +265,15 @@ func (outputChecker *OutputChecker) PackNamedOutputs() []byte {
return enc
}
// TryPackNamedOutputs is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x7970a189. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function namedOutputs() returns(string str1, string str2)
func (outputChecker *OutputChecker) TryPackNamedOutputs() ([]byte, error) {
return outputChecker.abi.Pack("namedOutputs")
}
// NamedOutputsOutput serves as a container for the return parameters of contract
// method NamedOutputs.
type NamedOutputsOutput struct {
@ -236,12 +293,12 @@ func (outputChecker *OutputChecker) UnpackNamedOutputs(data []byte) (NamedOutput
}
outstruct.Str1 = *abi.ConvertType(out[0], new(string)).(*string)
outstruct.Str2 = *abi.ConvertType(out[1], new(string)).(*string)
return *outstruct, err
return *outstruct, nil
}
// PackNoOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x625f0306.
// the contract method with ID 0x625f0306. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function noOutput() returns()
func (outputChecker *OutputChecker) PackNoOutput() []byte {
@ -251,3 +308,12 @@ func (outputChecker *OutputChecker) PackNoOutput() []byte {
}
return enc
}
// TryPackNoOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x625f0306. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function noOutput() returns()
func (outputChecker *OutputChecker) TryPackNoOutput() ([]byte, error) {
return outputChecker.abi.Pack("noOutput")
}

View file

@ -52,7 +52,8 @@ func (c *Overload) Instance(backend bind.ContractBackend, addr common.Address) *
}
// PackFoo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x04bc52f8.
// the contract method with ID 0x04bc52f8. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function foo(uint256 i, uint256 j) returns()
func (overload *Overload) PackFoo(i *big.Int, j *big.Int) []byte {
@ -63,8 +64,18 @@ func (overload *Overload) PackFoo(i *big.Int, j *big.Int) []byte {
return enc
}
// TryPackFoo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x04bc52f8. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function foo(uint256 i, uint256 j) returns()
func (overload *Overload) TryPackFoo(i *big.Int, j *big.Int) ([]byte, error) {
return overload.abi.Pack("foo", i, j)
}
// PackFoo0 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2fbebd38.
// the contract method with ID 0x2fbebd38. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function foo(uint256 i) returns()
func (overload *Overload) PackFoo0(i *big.Int) []byte {
@ -75,6 +86,15 @@ func (overload *Overload) PackFoo0(i *big.Int) []byte {
return enc
}
// TryPackFoo0 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2fbebd38. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function foo(uint256 i) returns()
func (overload *Overload) TryPackFoo0(i *big.Int) ([]byte, error) {
return overload.abi.Pack("foo0", i)
}
// OverloadBar represents a bar event raised by the Overload contract.
type OverloadBar struct {
I *big.Int

View file

@ -52,7 +52,8 @@ func (c *RangeKeyword) Instance(backend bind.ContractBackend, addr common.Addres
}
// PackFunctionWithKeywordParameter is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x527a119f.
// the contract method with ID 0x527a119f. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function functionWithKeywordParameter(uint256 range) pure returns()
func (rangeKeyword *RangeKeyword) PackFunctionWithKeywordParameter(arg0 *big.Int) []byte {
@ -62,3 +63,12 @@ func (rangeKeyword *RangeKeyword) PackFunctionWithKeywordParameter(arg0 *big.Int
}
return enc
}
// TryPackFunctionWithKeywordParameter is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x527a119f. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function functionWithKeywordParameter(uint256 range) pure returns()
func (rangeKeyword *RangeKeyword) TryPackFunctionWithKeywordParameter(arg0 *big.Int) ([]byte, error) {
return rangeKeyword.abi.Pack("functionWithKeywordParameter", arg0)
}

View file

@ -52,7 +52,8 @@ func (c *Slicer) Instance(backend bind.ContractBackend, addr common.Address) *bi
}
// PackEchoAddresses is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbe1127a3.
// the contract method with ID 0xbe1127a3. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function echoAddresses(address[] input) returns(address[] output)
func (slicer *Slicer) PackEchoAddresses(input []common.Address) []byte {
@ -63,6 +64,15 @@ func (slicer *Slicer) PackEchoAddresses(input []common.Address) []byte {
return enc
}
// TryPackEchoAddresses is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbe1127a3. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function echoAddresses(address[] input) returns(address[] output)
func (slicer *Slicer) TryPackEchoAddresses(input []common.Address) ([]byte, error) {
return slicer.abi.Pack("echoAddresses", input)
}
// UnpackEchoAddresses is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xbe1127a3.
//
@ -73,11 +83,12 @@ func (slicer *Slicer) UnpackEchoAddresses(data []byte) ([]common.Address, error)
return *new([]common.Address), err
}
out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)
return out0, err
return out0, nil
}
// PackEchoBools is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xf637e589.
// the contract method with ID 0xf637e589. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function echoBools(bool[] input) returns(bool[] output)
func (slicer *Slicer) PackEchoBools(input []bool) []byte {
@ -88,6 +99,15 @@ func (slicer *Slicer) PackEchoBools(input []bool) []byte {
return enc
}
// TryPackEchoBools is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xf637e589. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function echoBools(bool[] input) returns(bool[] output)
func (slicer *Slicer) TryPackEchoBools(input []bool) ([]byte, error) {
return slicer.abi.Pack("echoBools", input)
}
// UnpackEchoBools is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xf637e589.
//
@ -98,11 +118,12 @@ func (slicer *Slicer) UnpackEchoBools(data []byte) ([]bool, error) {
return *new([]bool), err
}
out0 := *abi.ConvertType(out[0], new([]bool)).(*[]bool)
return out0, err
return out0, nil
}
// PackEchoFancyInts is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd88becc0.
// the contract method with ID 0xd88becc0. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function echoFancyInts(uint24[23] input) returns(uint24[23] output)
func (slicer *Slicer) PackEchoFancyInts(input [23]*big.Int) []byte {
@ -113,6 +134,15 @@ func (slicer *Slicer) PackEchoFancyInts(input [23]*big.Int) []byte {
return enc
}
// TryPackEchoFancyInts is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd88becc0. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function echoFancyInts(uint24[23] input) returns(uint24[23] output)
func (slicer *Slicer) TryPackEchoFancyInts(input [23]*big.Int) ([]byte, error) {
return slicer.abi.Pack("echoFancyInts", input)
}
// UnpackEchoFancyInts is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xd88becc0.
//
@ -123,11 +153,12 @@ func (slicer *Slicer) UnpackEchoFancyInts(data []byte) ([23]*big.Int, error) {
return *new([23]*big.Int), err
}
out0 := *abi.ConvertType(out[0], new([23]*big.Int)).(*[23]*big.Int)
return out0, err
return out0, nil
}
// PackEchoInts is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe15a3db7.
// the contract method with ID 0xe15a3db7. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function echoInts(int256[] input) returns(int256[] output)
func (slicer *Slicer) PackEchoInts(input []*big.Int) []byte {
@ -138,6 +169,15 @@ func (slicer *Slicer) PackEchoInts(input []*big.Int) []byte {
return enc
}
// TryPackEchoInts is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe15a3db7. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function echoInts(int256[] input) returns(int256[] output)
func (slicer *Slicer) TryPackEchoInts(input []*big.Int) ([]byte, error) {
return slicer.abi.Pack("echoInts", input)
}
// UnpackEchoInts is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xe15a3db7.
//
@ -148,5 +188,5 @@ func (slicer *Slicer) UnpackEchoInts(data []byte) ([]*big.Int, error) {
return *new([]*big.Int), err
}
out0 := *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int)
return out0, err
return out0, nil
}

View file

@ -57,7 +57,8 @@ func (c *Structs) Instance(backend bind.ContractBackend, addr common.Address) *b
}
// PackF is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x28811f59.
// the contract method with ID 0x28811f59. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
func (structs *Structs) PackF() []byte {
@ -68,6 +69,15 @@ func (structs *Structs) PackF() []byte {
return enc
}
// TryPackF is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x28811f59. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function F() view returns((bytes32)[] a, uint256[] c, bool[] d)
func (structs *Structs) TryPackF() ([]byte, error) {
return structs.abi.Pack("F")
}
// FOutput serves as a container for the return parameters of contract
// method F.
type FOutput struct {
@ -89,12 +99,12 @@ func (structs *Structs) UnpackF(data []byte) (FOutput, error) {
outstruct.A = *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
outstruct.C = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)
outstruct.D = *abi.ConvertType(out[2], new([]bool)).(*[]bool)
return *outstruct, err
return *outstruct, nil
}
// PackG is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6fecb623.
// the contract method with ID 0x6fecb623. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function G() view returns((bytes32)[] a)
func (structs *Structs) PackG() []byte {
@ -105,6 +115,15 @@ func (structs *Structs) PackG() []byte {
return enc
}
// TryPackG is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6fecb623. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function G() view returns((bytes32)[] a)
func (structs *Structs) TryPackG() ([]byte, error) {
return structs.abi.Pack("G")
}
// UnpackG is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x6fecb623.
//
@ -115,5 +134,5 @@ func (structs *Structs) UnpackG(data []byte) ([]Struct0, error) {
return *new([]Struct0), err
}
out0 := *abi.ConvertType(out[0], new([]Struct0)).(*[]Struct0)
return out0, err
return out0, nil
}

View file

@ -64,7 +64,8 @@ func (token *Token) PackConstructor(initialSupply *big.Int, tokenName string, de
}
// PackAllowance is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xdd62ed3e.
// the contract method with ID 0xdd62ed3e. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function allowance(address , address ) returns(uint256)
func (token *Token) PackAllowance(arg0 common.Address, arg1 common.Address) []byte {
@ -75,6 +76,15 @@ func (token *Token) PackAllowance(arg0 common.Address, arg1 common.Address) []by
return enc
}
// TryPackAllowance is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xdd62ed3e. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function allowance(address , address ) returns(uint256)
func (token *Token) TryPackAllowance(arg0 common.Address, arg1 common.Address) ([]byte, error) {
return token.abi.Pack("allowance", arg0, arg1)
}
// UnpackAllowance is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xdd62ed3e.
//
@ -85,11 +95,12 @@ func (token *Token) UnpackAllowance(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackApproveAndCall is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xcae9ca51.
// the contract method with ID 0xcae9ca51. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns(bool success)
func (token *Token) PackApproveAndCall(spender common.Address, value *big.Int, extraData []byte) []byte {
@ -100,6 +111,15 @@ func (token *Token) PackApproveAndCall(spender common.Address, value *big.Int, e
return enc
}
// TryPackApproveAndCall is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xcae9ca51. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns(bool success)
func (token *Token) TryPackApproveAndCall(spender common.Address, value *big.Int, extraData []byte) ([]byte, error) {
return token.abi.Pack("approveAndCall", spender, value, extraData)
}
// UnpackApproveAndCall is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xcae9ca51.
//
@ -110,11 +130,12 @@ func (token *Token) UnpackApproveAndCall(data []byte) (bool, error) {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
return out0, nil
}
// PackBalanceOf is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x70a08231.
// the contract method with ID 0x70a08231. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function balanceOf(address ) returns(uint256)
func (token *Token) PackBalanceOf(arg0 common.Address) []byte {
@ -125,6 +146,15 @@ func (token *Token) PackBalanceOf(arg0 common.Address) []byte {
return enc
}
// TryPackBalanceOf is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x70a08231. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function balanceOf(address ) returns(uint256)
func (token *Token) TryPackBalanceOf(arg0 common.Address) ([]byte, error) {
return token.abi.Pack("balanceOf", arg0)
}
// UnpackBalanceOf is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x70a08231.
//
@ -135,11 +165,12 @@ func (token *Token) UnpackBalanceOf(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackDecimals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x313ce567.
// the contract method with ID 0x313ce567. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function decimals() returns(uint8)
func (token *Token) PackDecimals() []byte {
@ -150,6 +181,15 @@ func (token *Token) PackDecimals() []byte {
return enc
}
// TryPackDecimals is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x313ce567. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function decimals() returns(uint8)
func (token *Token) TryPackDecimals() ([]byte, error) {
return token.abi.Pack("decimals")
}
// UnpackDecimals is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x313ce567.
//
@ -160,11 +200,12 @@ func (token *Token) UnpackDecimals(data []byte) (uint8, error) {
return *new(uint8), err
}
out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
return out0, err
return out0, nil
}
// PackName is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x06fdde03.
// the contract method with ID 0x06fdde03. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function name() returns(string)
func (token *Token) PackName() []byte {
@ -175,6 +216,15 @@ func (token *Token) PackName() []byte {
return enc
}
// TryPackName is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x06fdde03. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function name() returns(string)
func (token *Token) TryPackName() ([]byte, error) {
return token.abi.Pack("name")
}
// UnpackName is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x06fdde03.
//
@ -185,11 +235,12 @@ func (token *Token) UnpackName(data []byte) (string, error) {
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
return out0, nil
}
// PackSpentAllowance is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xdc3080f2.
// the contract method with ID 0xdc3080f2. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function spentAllowance(address , address ) returns(uint256)
func (token *Token) PackSpentAllowance(arg0 common.Address, arg1 common.Address) []byte {
@ -200,6 +251,15 @@ func (token *Token) PackSpentAllowance(arg0 common.Address, arg1 common.Address)
return enc
}
// TryPackSpentAllowance is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xdc3080f2. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function spentAllowance(address , address ) returns(uint256)
func (token *Token) TryPackSpentAllowance(arg0 common.Address, arg1 common.Address) ([]byte, error) {
return token.abi.Pack("spentAllowance", arg0, arg1)
}
// UnpackSpentAllowance is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xdc3080f2.
//
@ -210,11 +270,12 @@ func (token *Token) UnpackSpentAllowance(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackSymbol is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x95d89b41.
// the contract method with ID 0x95d89b41. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function symbol() returns(string)
func (token *Token) PackSymbol() []byte {
@ -225,6 +286,15 @@ func (token *Token) PackSymbol() []byte {
return enc
}
// TryPackSymbol is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x95d89b41. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function symbol() returns(string)
func (token *Token) TryPackSymbol() ([]byte, error) {
return token.abi.Pack("symbol")
}
// UnpackSymbol is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x95d89b41.
//
@ -235,11 +305,12 @@ func (token *Token) UnpackSymbol(data []byte) (string, error) {
return *new(string), err
}
out0 := *abi.ConvertType(out[0], new(string)).(*string)
return out0, err
return out0, nil
}
// PackTransfer is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xa9059cbb.
// the contract method with ID 0xa9059cbb. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function transfer(address _to, uint256 _value) returns()
func (token *Token) PackTransfer(to common.Address, value *big.Int) []byte {
@ -250,8 +321,18 @@ func (token *Token) PackTransfer(to common.Address, value *big.Int) []byte {
return enc
}
// TryPackTransfer is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xa9059cbb. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function transfer(address _to, uint256 _value) returns()
func (token *Token) TryPackTransfer(to common.Address, value *big.Int) ([]byte, error) {
return token.abi.Pack("transfer", to, value)
}
// PackTransferFrom is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x23b872dd.
// the contract method with ID 0x23b872dd. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool success)
func (token *Token) PackTransferFrom(from common.Address, to common.Address, value *big.Int) []byte {
@ -262,6 +343,15 @@ func (token *Token) PackTransferFrom(from common.Address, to common.Address, val
return enc
}
// TryPackTransferFrom is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x23b872dd. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool success)
func (token *Token) TryPackTransferFrom(from common.Address, to common.Address, value *big.Int) ([]byte, error) {
return token.abi.Pack("transferFrom", from, to, value)
}
// UnpackTransferFrom is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x23b872dd.
//
@ -272,7 +362,7 @@ func (token *Token) UnpackTransferFrom(data []byte) (bool, error) {
return *new(bool), err
}
out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
return out0, err
return out0, nil
}
// TokenTransfer represents a Transfer event raised by the Token contract.

View file

@ -77,7 +77,8 @@ func (c *Tuple) Instance(backend bind.ContractBackend, addr common.Address) *bin
}
// PackFunc1 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x443c79b4.
// the contract method with ID 0x443c79b4. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function func1((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) pure returns((uint256,uint256[],(uint256,uint256)[]), (uint256,uint256)[2][], (uint256,uint256)[][2], (uint256,uint256[],(uint256,uint256)[])[], uint256[])
func (tuple *Tuple) PackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) []byte {
@ -88,6 +89,15 @@ func (tuple *Tuple) PackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS
return enc
}
// TryPackFunc1 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x443c79b4. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function func1((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) pure returns((uint256,uint256[],(uint256,uint256)[]), (uint256,uint256)[2][], (uint256,uint256)[][2], (uint256,uint256[],(uint256,uint256)[])[], uint256[])
func (tuple *Tuple) TryPackFunc1(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) ([]byte, error) {
return tuple.abi.Pack("func1", a, b, c, d, e)
}
// Func1Output serves as a container for the return parameters of contract
// method Func1.
type Func1Output struct {
@ -113,12 +123,12 @@ func (tuple *Tuple) UnpackFunc1(data []byte) (Func1Output, error) {
outstruct.Arg2 = *abi.ConvertType(out[2], new([2][]TupleT)).(*[2][]TupleT)
outstruct.Arg3 = *abi.ConvertType(out[3], new([]TupleS)).(*[]TupleS)
outstruct.Arg4 = *abi.ConvertType(out[4], new([]*big.Int)).(*[]*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackFunc2 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd0062cdd.
// the contract method with ID 0xd0062cdd. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function func2((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) returns()
func (tuple *Tuple) PackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) []byte {
@ -129,8 +139,18 @@ func (tuple *Tuple) PackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS
return enc
}
// TryPackFunc2 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xd0062cdd. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function func2((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e) returns()
func (tuple *Tuple) TryPackFunc2(a TupleS, b [][2]TupleT, c [2][]TupleT, d []TupleS, e []*big.Int) ([]byte, error) {
return tuple.abi.Pack("func2", a, b, c, d, e)
}
// PackFunc3 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe4d9a43b.
// the contract method with ID 0xe4d9a43b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function func3((uint16,uint16)[] ) pure returns()
func (tuple *Tuple) PackFunc3(arg0 []TupleQ) []byte {
@ -141,6 +161,15 @@ func (tuple *Tuple) PackFunc3(arg0 []TupleQ) []byte {
return enc
}
// TryPackFunc3 is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe4d9a43b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function func3((uint16,uint16)[] ) pure returns()
func (tuple *Tuple) TryPackFunc3(arg0 []TupleQ) ([]byte, error) {
return tuple.abi.Pack("func3", arg0)
}
// TupleTupleEvent represents a TupleEvent event raised by the Tuple contract.
type TupleTupleEvent struct {
A TupleS

View file

@ -52,7 +52,8 @@ func (c *Tupler) Instance(backend bind.ContractBackend, addr common.Address) *bi
}
// PackTuple is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x3175aae2.
// the contract method with ID 0x3175aae2. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function tuple() returns(string a, int256 b, bytes32 c)
func (tupler *Tupler) PackTuple() []byte {
@ -63,6 +64,15 @@ func (tupler *Tupler) PackTuple() []byte {
return enc
}
// TryPackTuple is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x3175aae2. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function tuple() returns(string a, int256 b, bytes32 c)
func (tupler *Tupler) TryPackTuple() ([]byte, error) {
return tupler.abi.Pack("tuple")
}
// TupleOutput serves as a container for the return parameters of contract
// method Tuple.
type TupleOutput struct {
@ -84,6 +94,5 @@ func (tupler *Tupler) UnpackTuple(data []byte) (TupleOutput, error) {
outstruct.A = *abi.ConvertType(out[0], new(string)).(*string)
outstruct.B = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
outstruct.C = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte)
return *outstruct, err
return *outstruct, nil
}

View file

@ -52,7 +52,8 @@ func (c *Underscorer) Instance(backend bind.ContractBackend, addr common.Address
}
// PackAllPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb564b34d.
// the contract method with ID 0xb564b34d. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function AllPurelyUnderscoredOutput() view returns(int256 _, int256 __)
func (underscorer *Underscorer) PackAllPurelyUnderscoredOutput() []byte {
@ -63,6 +64,15 @@ func (underscorer *Underscorer) PackAllPurelyUnderscoredOutput() []byte {
return enc
}
// TryPackAllPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb564b34d. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function AllPurelyUnderscoredOutput() view returns(int256 _, int256 __)
func (underscorer *Underscorer) TryPackAllPurelyUnderscoredOutput() ([]byte, error) {
return underscorer.abi.Pack("AllPurelyUnderscoredOutput")
}
// AllPurelyUnderscoredOutputOutput serves as a container for the return parameters of contract
// method AllPurelyUnderscoredOutput.
type AllPurelyUnderscoredOutputOutput struct {
@ -82,12 +92,12 @@ func (underscorer *Underscorer) UnpackAllPurelyUnderscoredOutput(data []byte) (A
}
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackLowerLowerCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe409ca45.
// the contract method with ID 0xe409ca45. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function LowerLowerCollision() view returns(int256 _res, int256 res)
func (underscorer *Underscorer) PackLowerLowerCollision() []byte {
@ -98,6 +108,15 @@ func (underscorer *Underscorer) PackLowerLowerCollision() []byte {
return enc
}
// TryPackLowerLowerCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe409ca45. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function LowerLowerCollision() view returns(int256 _res, int256 res)
func (underscorer *Underscorer) TryPackLowerLowerCollision() ([]byte, error) {
return underscorer.abi.Pack("LowerLowerCollision")
}
// LowerLowerCollisionOutput serves as a container for the return parameters of contract
// method LowerLowerCollision.
type LowerLowerCollisionOutput struct {
@ -117,12 +136,12 @@ func (underscorer *Underscorer) UnpackLowerLowerCollision(data []byte) (LowerLow
}
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackLowerUpperCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x03a59213.
// the contract method with ID 0x03a59213. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function LowerUpperCollision() view returns(int256 _res, int256 Res)
func (underscorer *Underscorer) PackLowerUpperCollision() []byte {
@ -133,6 +152,15 @@ func (underscorer *Underscorer) PackLowerUpperCollision() []byte {
return enc
}
// TryPackLowerUpperCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x03a59213. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function LowerUpperCollision() view returns(int256 _res, int256 Res)
func (underscorer *Underscorer) TryPackLowerUpperCollision() ([]byte, error) {
return underscorer.abi.Pack("LowerUpperCollision")
}
// LowerUpperCollisionOutput serves as a container for the return parameters of contract
// method LowerUpperCollision.
type LowerUpperCollisionOutput struct {
@ -152,12 +180,12 @@ func (underscorer *Underscorer) UnpackLowerUpperCollision(data []byte) (LowerUpp
}
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9df48485.
// the contract method with ID 0x9df48485. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function PurelyUnderscoredOutput() view returns(int256 _, int256 res)
func (underscorer *Underscorer) PackPurelyUnderscoredOutput() []byte {
@ -168,6 +196,15 @@ func (underscorer *Underscorer) PackPurelyUnderscoredOutput() []byte {
return enc
}
// TryPackPurelyUnderscoredOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9df48485. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function PurelyUnderscoredOutput() view returns(int256 _, int256 res)
func (underscorer *Underscorer) TryPackPurelyUnderscoredOutput() ([]byte, error) {
return underscorer.abi.Pack("PurelyUnderscoredOutput")
}
// PurelyUnderscoredOutputOutput serves as a container for the return parameters of contract
// method PurelyUnderscoredOutput.
type PurelyUnderscoredOutputOutput struct {
@ -187,12 +224,12 @@ func (underscorer *Underscorer) UnpackPurelyUnderscoredOutput(data []byte) (Pure
}
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Res = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackUnderscoredOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x67e6633d.
// the contract method with ID 0x67e6633d. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function UnderscoredOutput() view returns(int256 _int, string _string)
func (underscorer *Underscorer) PackUnderscoredOutput() []byte {
@ -203,6 +240,15 @@ func (underscorer *Underscorer) PackUnderscoredOutput() []byte {
return enc
}
// TryPackUnderscoredOutput is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x67e6633d. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function UnderscoredOutput() view returns(int256 _int, string _string)
func (underscorer *Underscorer) TryPackUnderscoredOutput() ([]byte, error) {
return underscorer.abi.Pack("UnderscoredOutput")
}
// UnderscoredOutputOutput serves as a container for the return parameters of contract
// method UnderscoredOutput.
type UnderscoredOutputOutput struct {
@ -222,12 +268,12 @@ func (underscorer *Underscorer) UnpackUnderscoredOutput(data []byte) (Underscore
}
outstruct.Int = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.String = *abi.ConvertType(out[1], new(string)).(*string)
return *outstruct, err
return *outstruct, nil
}
// PackUpperLowerCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xaf7486ab.
// the contract method with ID 0xaf7486ab. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function UpperLowerCollision() view returns(int256 _Res, int256 res)
func (underscorer *Underscorer) PackUpperLowerCollision() []byte {
@ -238,6 +284,15 @@ func (underscorer *Underscorer) PackUpperLowerCollision() []byte {
return enc
}
// TryPackUpperLowerCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xaf7486ab. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function UpperLowerCollision() view returns(int256 _Res, int256 res)
func (underscorer *Underscorer) TryPackUpperLowerCollision() ([]byte, error) {
return underscorer.abi.Pack("UpperLowerCollision")
}
// UpperLowerCollisionOutput serves as a container for the return parameters of contract
// method UpperLowerCollision.
type UpperLowerCollisionOutput struct {
@ -257,12 +312,12 @@ func (underscorer *Underscorer) UnpackUpperLowerCollision(data []byte) (UpperLow
}
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackUpperUpperCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe02ab24d.
// the contract method with ID 0xe02ab24d. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function UpperUpperCollision() view returns(int256 _Res, int256 Res)
func (underscorer *Underscorer) PackUpperUpperCollision() []byte {
@ -273,6 +328,15 @@ func (underscorer *Underscorer) PackUpperUpperCollision() []byte {
return enc
}
// TryPackUpperUpperCollision is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe02ab24d. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function UpperUpperCollision() view returns(int256 _Res, int256 Res)
func (underscorer *Underscorer) TryPackUpperUpperCollision() ([]byte, error) {
return underscorer.abi.Pack("UpperUpperCollision")
}
// UpperUpperCollisionOutput serves as a container for the return parameters of contract
// method UpperUpperCollision.
type UpperUpperCollisionOutput struct {
@ -292,12 +356,12 @@ func (underscorer *Underscorer) UnpackUpperUpperCollision(data []byte) (UpperUpp
}
outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackUnderScoredFunc is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x46546dbe.
// the contract method with ID 0x46546dbe. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function _under_scored_func() view returns(int256 _int)
func (underscorer *Underscorer) PackUnderScoredFunc() []byte {
@ -308,6 +372,15 @@ func (underscorer *Underscorer) PackUnderScoredFunc() []byte {
return enc
}
// TryPackUnderScoredFunc is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x46546dbe. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function _under_scored_func() view returns(int256 _int)
func (underscorer *Underscorer) TryPackUnderScoredFunc() ([]byte, error) {
return underscorer.abi.Pack("_under_scored_func")
}
// UnpackUnderScoredFunc is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x46546dbe.
//
@ -318,5 +391,5 @@ func (underscorer *Underscorer) UnpackUnderScoredFunc(data []byte) (*big.Int, er
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}

View file

@ -59,7 +59,8 @@ func (c *DB) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
}
// PackGet is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9507d39a.
// the contract method with ID 0x9507d39a. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function get(uint256 k) returns(uint256)
func (dB *DB) PackGet(k *big.Int) []byte {
@ -70,6 +71,15 @@ func (dB *DB) PackGet(k *big.Int) []byte {
return enc
}
// TryPackGet is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x9507d39a. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function get(uint256 k) returns(uint256)
func (dB *DB) TryPackGet(k *big.Int) ([]byte, error) {
return dB.abi.Pack("get", k)
}
// UnpackGet is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x9507d39a.
//
@ -80,11 +90,12 @@ func (dB *DB) UnpackGet(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// PackGetNamedStatParams is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe369ba3b.
// the contract method with ID 0xe369ba3b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function getNamedStatParams() view returns(uint256 gets, uint256 inserts, uint256 mods)
func (dB *DB) PackGetNamedStatParams() []byte {
@ -95,6 +106,15 @@ func (dB *DB) PackGetNamedStatParams() []byte {
return enc
}
// TryPackGetNamedStatParams is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe369ba3b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function getNamedStatParams() view returns(uint256 gets, uint256 inserts, uint256 mods)
func (dB *DB) TryPackGetNamedStatParams() ([]byte, error) {
return dB.abi.Pack("getNamedStatParams")
}
// GetNamedStatParamsOutput serves as a container for the return parameters of contract
// method GetNamedStatParams.
type GetNamedStatParamsOutput struct {
@ -116,12 +136,12 @@ func (dB *DB) UnpackGetNamedStatParams(data []byte) (GetNamedStatParamsOutput, e
outstruct.Gets = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Inserts = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
outstruct.Mods = abi.ConvertType(out[2], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackGetStatParams is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6fcb9c70.
// the contract method with ID 0x6fcb9c70. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function getStatParams() view returns(uint256, uint256, uint256)
func (dB *DB) PackGetStatParams() []byte {
@ -132,6 +152,15 @@ func (dB *DB) PackGetStatParams() []byte {
return enc
}
// TryPackGetStatParams is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x6fcb9c70. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function getStatParams() view returns(uint256, uint256, uint256)
func (dB *DB) TryPackGetStatParams() ([]byte, error) {
return dB.abi.Pack("getStatParams")
}
// GetStatParamsOutput serves as a container for the return parameters of contract
// method GetStatParams.
type GetStatParamsOutput struct {
@ -153,12 +182,12 @@ func (dB *DB) UnpackGetStatParams(data []byte) (GetStatParamsOutput, error) {
outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int)
outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int)
outstruct.Arg2 = abi.ConvertType(out[2], new(big.Int)).(*big.Int)
return *outstruct, err
return *outstruct, nil
}
// PackGetStatsStruct is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xee8161e0.
// the contract method with ID 0xee8161e0. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function getStatsStruct() view returns((uint256,uint256,uint256))
func (dB *DB) PackGetStatsStruct() []byte {
@ -169,6 +198,15 @@ func (dB *DB) PackGetStatsStruct() []byte {
return enc
}
// TryPackGetStatsStruct is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xee8161e0. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function getStatsStruct() view returns((uint256,uint256,uint256))
func (dB *DB) TryPackGetStatsStruct() ([]byte, error) {
return dB.abi.Pack("getStatsStruct")
}
// UnpackGetStatsStruct is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xee8161e0.
//
@ -179,11 +217,12 @@ func (dB *DB) UnpackGetStatsStruct(data []byte) (DBStats, error) {
return *new(DBStats), err
}
out0 := *abi.ConvertType(out[0], new(DBStats)).(*DBStats)
return out0, err
return out0, nil
}
// PackInsert is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x1d834a1b.
// the contract method with ID 0x1d834a1b. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function insert(uint256 k, uint256 v) returns(uint256)
func (dB *DB) PackInsert(k *big.Int, v *big.Int) []byte {
@ -194,6 +233,15 @@ func (dB *DB) PackInsert(k *big.Int, v *big.Int) []byte {
return enc
}
// TryPackInsert is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x1d834a1b. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function insert(uint256 k, uint256 v) returns(uint256)
func (dB *DB) TryPackInsert(k *big.Int, v *big.Int) ([]byte, error) {
return dB.abi.Pack("insert", k, v)
}
// UnpackInsert is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x1d834a1b.
//
@ -204,7 +252,7 @@ func (dB *DB) UnpackInsert(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// DBInsert represents a Insert event raised by the DB contract.

View file

@ -52,7 +52,8 @@ func (c *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.Bo
}
// PackEmitMulti is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xcb493749.
// the contract method with ID 0xcb493749. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function EmitMulti() returns()
func (c *C) PackEmitMulti() []byte {
@ -63,8 +64,18 @@ func (c *C) PackEmitMulti() []byte {
return enc
}
// TryPackEmitMulti is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xcb493749. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function EmitMulti() returns()
func (c *C) TryPackEmitMulti() ([]byte, error) {
return c.abi.Pack("EmitMulti")
}
// PackEmitOne is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe8e49a71.
// the contract method with ID 0xe8e49a71. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function EmitOne() returns()
func (c *C) PackEmitOne() []byte {
@ -75,6 +86,15 @@ func (c *C) PackEmitOne() []byte {
return enc
}
// TryPackEmitOne is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xe8e49a71. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function EmitOne() returns()
func (c *C) TryPackEmitOne() ([]byte, error) {
return c.abi.Pack("EmitOne")
}
// CBasic1 represents a basic1 event raised by the C contract.
type CBasic1 struct {
Id *big.Int

View file

@ -68,7 +68,8 @@ func (c1 *C1) PackConstructor(v1 *big.Int, v2 *big.Int) []byte {
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256 res)
func (c1 *C1) PackDo(val *big.Int) []byte {
@ -79,6 +80,15 @@ func (c1 *C1) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256 res)
func (c1 *C1) TryPackDo(val *big.Int) ([]byte, error) {
return c1.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -89,7 +99,7 @@ func (c1 *C1) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// C2MetaData contains all meta data concerning the C2 contract.
@ -136,7 +146,8 @@ func (c2 *C2) PackConstructor(v1 *big.Int, v2 *big.Int) []byte {
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256 res)
func (c2 *C2) PackDo(val *big.Int) []byte {
@ -147,6 +158,15 @@ func (c2 *C2) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256 res)
func (c2 *C2) TryPackDo(val *big.Int) ([]byte, error) {
return c2.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -157,7 +177,7 @@ func (c2 *C2) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// L1MetaData contains all meta data concerning the L1 contract.
@ -188,7 +208,8 @@ func (c *L1) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l1 *L1) PackDo(val *big.Int) []byte {
@ -199,6 +220,15 @@ func (l1 *L1) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l1 *L1) TryPackDo(val *big.Int) ([]byte, error) {
return l1.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -209,7 +239,7 @@ func (l1 *L1) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// L2MetaData contains all meta data concerning the L2 contract.
@ -243,7 +273,8 @@ func (c *L2) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l2 *L2) PackDo(val *big.Int) []byte {
@ -254,6 +285,15 @@ func (l2 *L2) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l2 *L2) TryPackDo(val *big.Int) ([]byte, error) {
return l2.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -264,7 +304,7 @@ func (l2 *L2) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// L2bMetaData contains all meta data concerning the L2b contract.
@ -298,7 +338,8 @@ func (c *L2b) Instance(backend bind.ContractBackend, addr common.Address) *bind.
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l2b *L2b) PackDo(val *big.Int) []byte {
@ -309,6 +350,15 @@ func (l2b *L2b) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l2b *L2b) TryPackDo(val *big.Int) ([]byte, error) {
return l2b.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -319,7 +369,7 @@ func (l2b *L2b) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// L3MetaData contains all meta data concerning the L3 contract.
@ -350,7 +400,8 @@ func (c *L3) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l3 *L3) PackDo(val *big.Int) []byte {
@ -361,6 +412,15 @@ func (l3 *L3) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l3 *L3) TryPackDo(val *big.Int) ([]byte, error) {
return l3.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -371,7 +431,7 @@ func (l3 *L3) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// L4MetaData contains all meta data concerning the L4 contract.
@ -406,7 +466,8 @@ func (c *L4) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l4 *L4) PackDo(val *big.Int) []byte {
@ -417,6 +478,15 @@ func (l4 *L4) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l4 *L4) TryPackDo(val *big.Int) ([]byte, error) {
return l4.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -427,7 +497,7 @@ func (l4 *L4) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}
// L4bMetaData contains all meta data concerning the L4b contract.
@ -461,7 +531,8 @@ func (c *L4b) Instance(backend bind.ContractBackend, addr common.Address) *bind.
}
// PackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272.
// the contract method with ID 0x2ad11272. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l4b *L4b) PackDo(val *big.Int) []byte {
@ -472,6 +543,15 @@ func (l4b *L4b) PackDo(val *big.Int) []byte {
return enc
}
// TryPackDo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0x2ad11272. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Do(uint256 val) pure returns(uint256)
func (l4b *L4b) TryPackDo(val *big.Int) ([]byte, error) {
return l4b.abi.Pack("Do", val)
}
// UnpackDo is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0x2ad11272.
//
@ -482,5 +562,5 @@ func (l4b *L4b) UnpackDo(data []byte) (*big.Int, error) {
return new(big.Int), err
}
out0 := abi.ConvertType(out[0], new(big.Int)).(*big.Int)
return out0, err
return out0, nil
}

View file

@ -52,7 +52,8 @@ func (c *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.Bo
}
// PackBar is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb0a378b0.
// the contract method with ID 0xb0a378b0. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Bar() pure returns()
func (c *C) PackBar() []byte {
@ -63,8 +64,18 @@ func (c *C) PackBar() []byte {
return enc
}
// TryPackBar is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xb0a378b0. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Bar() pure returns()
func (c *C) TryPackBar() ([]byte, error) {
return c.abi.Pack("Bar")
}
// PackFoo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbfb4ebcf.
// the contract method with ID 0xbfb4ebcf. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Foo() pure returns()
func (c *C) PackFoo() []byte {
@ -75,6 +86,15 @@ func (c *C) PackFoo() []byte {
return enc
}
// TryPackFoo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbfb4ebcf. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Foo() pure returns()
func (c *C) TryPackFoo() ([]byte, error) {
return c.abi.Pack("Foo")
}
// UnpackError attempts to decode the provided error data using user-defined
// error definitions.
func (c *C) UnpackError(raw []byte) (any, error) {
@ -169,7 +189,8 @@ func (c *C2) Instance(backend bind.ContractBackend, addr common.Address) *bind.B
}
// PackFoo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbfb4ebcf.
// the contract method with ID 0xbfb4ebcf. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function Foo() pure returns()
func (c2 *C2) PackFoo() []byte {
@ -180,6 +201,15 @@ func (c2 *C2) PackFoo() []byte {
return enc
}
// TryPackFoo is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbfb4ebcf. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function Foo() pure returns()
func (c2 *C2) TryPackFoo() ([]byte, error) {
return c2.abi.Pack("Foo")
}
// UnpackError attempts to decode the provided error data using user-defined
// error definitions.
func (c2 *C2) UnpackError(raw []byte) (any, error) {

View file

@ -52,7 +52,8 @@ func (c *MyContract) Instance(backend bind.ContractBackend, addr common.Address)
}
// PackGetNums is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbd6d1007.
// the contract method with ID 0xbd6d1007. This method will panic if any
// invalid/nil inputs are passed.
//
// Solidity: function GetNums() pure returns(uint256[5])
func (myContract *MyContract) PackGetNums() []byte {
@ -63,6 +64,15 @@ func (myContract *MyContract) PackGetNums() []byte {
return enc
}
// TryPackGetNums is the Go binding used to pack the parameters required for calling
// the contract method with ID 0xbd6d1007. This method will return an error
// if any inputs are invalid/nil.
//
// Solidity: function GetNums() pure returns(uint256[5])
func (myContract *MyContract) TryPackGetNums() ([]byte, error) {
return myContract.abi.Pack("GetNums")
}
// UnpackGetNums is the Go binding that unpacks the parameters returned
// from invoking the contract method with ID 0xbd6d1007.
//
@ -73,5 +83,5 @@ func (myContract *MyContract) UnpackGetNums(data []byte) ([5]*big.Int, error) {
return *new([5]*big.Int), err
}
out0 := *abi.ConvertType(out[0], new([5]*big.Int)).(*[5]*big.Int)
return out0, err
return out0, nil
}

View file

@ -65,7 +65,7 @@ The API-method `account_signGnosisSafeTx` was added. This method takes two param
```
Not all fields are required, though. This method is really just a UX helper, which massages the
input to conform to the `EIP-712` [specification](https://docs.gnosis.io/safe/docs/contracts_tx_execution/#transaction-hash)
input to conform to the `EIP-712` [specification](https://docs.safe.global/core-api/transaction-service-reference/gnosis)
for the Gnosis Safe, and making the output be directly importable to by a relay service.

View file

@ -183,6 +183,9 @@ func Transaction(ctx *cli.Context) error {
if chainConfig.IsShanghai(new(big.Int), 0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
r.Error = errors.New("max initcode size exceeded")
}
if chainConfig.IsOsaka(new(big.Int), 0) && tx.Gas() > params.MaxTxGas {
r.Error = errors.New("gas limit exceeds maximum")
}
results = append(results, r)
}
out, err := json.MarshalIndent(results, "", " ")

View file

@ -268,7 +268,7 @@ func makeFullNode(ctx *cli.Context) *node.Node {
if len(hex) != common.HashLength {
utils.Fatalf("invalid sync target length: have %d, want %d", len(hex), common.HashLength)
}
utils.RegisterFullSyncTester(stack, eth, common.BytesToHash(hex))
utils.RegisterFullSyncTester(stack, eth, common.BytesToHash(hex), ctx.Bool(utils.ExitWhenSyncedFlag.Name))
}
if ctx.IsSet(utils.DeveloperFlag.Name) {

View file

@ -261,7 +261,7 @@ var (
}
GCModeFlag = &cli.StringFlag{
Name: "gcmode",
Usage: `Blockchain garbage collection mode, only relevant in state.scheme=hash ("full", "archive")`,
Usage: `Blockchain garbage collection mode ("full", "archive")`,
Value: "full",
Category: flags.StateCategory,
}
@ -1379,13 +1379,13 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
cfg.UseLightweightKDF = ctx.Bool(LightKDFFlag.Name)
}
if ctx.IsSet(NoUSBFlag.Name) || cfg.NoUSB {
log.Warn("Option nousb is deprecated and USB is deactivated by default. Use --usb to enable")
log.Warn("Option --nousb is deprecated and USB is deactivated by default. Use --usb to enable")
}
if ctx.IsSet(USBFlag.Name) {
cfg.USB = ctx.Bool(USBFlag.Name)
}
if ctx.IsSet(InsecureUnlockAllowedFlag.Name) {
log.Warn(fmt.Sprintf("Option %q is deprecated and has no effect", InsecureUnlockAllowedFlag.Name))
log.Warn(fmt.Sprintf("Option --%s is deprecated and has no effect", InsecureUnlockAllowedFlag.Name))
}
if ctx.IsSet(DBEngineFlag.Name) {
dbEngine := ctx.String(DBEngineFlag.Name)
@ -1397,10 +1397,10 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
}
// deprecation notice for log debug flags (TODO: find a more appropriate place to put these?)
if ctx.IsSet(LogBacktraceAtFlag.Name) {
log.Warn("log.backtrace flag is deprecated")
log.Warn("Option --log.backtrace flag is deprecated")
}
if ctx.IsSet(LogDebugFlag.Name) {
log.Warn("log.debug flag is deprecated")
log.Warn("Option --log.debug flag is deprecated")
}
}
@ -1859,7 +1859,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
func MakeBeaconLightConfig(ctx *cli.Context) bparams.ClientConfig {
var config bparams.ClientConfig
customConfig := ctx.IsSet(BeaconConfigFlag.Name)
flags.CheckExclusive(ctx, MainnetFlag, SepoliaFlag, HoleskyFlag, BeaconConfigFlag)
flags.CheckExclusive(ctx, MainnetFlag, SepoliaFlag, HoleskyFlag, HoodiFlag, BeaconConfigFlag)
switch {
case ctx.Bool(MainnetFlag.Name):
config.ChainConfig = *bparams.MainnetLightConfig
@ -1998,9 +1998,9 @@ func RegisterFilterAPI(stack *node.Node, backend ethapi.Backend, ethcfg *ethconf
}
// RegisterFullSyncTester adds the full-sync tester service into node.
func RegisterFullSyncTester(stack *node.Node, eth *eth.Ethereum, target common.Hash) {
catalyst.RegisterFullSyncTester(stack, eth, target)
log.Info("Registered full-sync tester", "hash", target)
func RegisterFullSyncTester(stack *node.Node, eth *eth.Ethereum, target common.Hash, exitWhenSynced bool) {
catalyst.RegisterFullSyncTester(stack, eth, target, exitWhenSynced)
log.Info("Registered full-sync tester", "hash", target, "exitWhenSynced", exitWhenSynced)
}
// SetupMetrics configures the metrics system.

View file

@ -44,40 +44,50 @@ var DeprecatedFlags = []cli.Flag{
MinerNewPayloadTimeoutFlag,
MinerEtherbaseFlag,
MiningEnabledFlag,
MetricsEnabledExpensiveFlag,
EnablePersonal,
UnlockedAccountFlag,
InsecureUnlockAllowedFlag,
}
var (
// Deprecated May 2020, shown in aliased flags section
NoUSBFlag = &cli.BoolFlag{
Name: "nousb",
Hidden: true,
Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
Category: flags.DeprecatedCategory,
}
// Deprecated March 2022
LegacyWhitelistFlag = &cli.StringFlag{
Name: "whitelist",
Hidden: true,
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)",
Category: flags.DeprecatedCategory,
}
// Deprecated July 2023
CacheTrieJournalFlag = &cli.StringFlag{
Name: "cache.trie.journal",
Hidden: true,
Usage: "Disk journal directory for trie cache to survive node restarts",
Category: flags.DeprecatedCategory,
}
CacheTrieRejournalFlag = &cli.DurationFlag{
Name: "cache.trie.rejournal",
Hidden: true,
Usage: "Time interval to regenerate the trie cache journal",
Category: flags.DeprecatedCategory,
}
LegacyDiscoveryV5Flag = &cli.BoolFlag{
Name: "v5disc",
Hidden: true,
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism (deprecated, use --discv5 instead)",
Category: flags.DeprecatedCategory,
}
// Deprecated August 2023
TxLookupLimitFlag = &cli.Uint64Flag{
Name: "txlookuplimit",
Hidden: true,
Usage: "Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (deprecated, use history.transactions instead)",
Value: ethconfig.Defaults.TransactionHistory,
Category: flags.DeprecatedCategory,
@ -85,51 +95,60 @@ var (
// Deprecated November 2023
LogBacktraceAtFlag = &cli.StringFlag{
Name: "log.backtrace",
Hidden: true,
Usage: "Request a stack trace at a specific logging statement (deprecated)",
Value: "",
Category: flags.DeprecatedCategory,
}
LogDebugFlag = &cli.BoolFlag{
Name: "log.debug",
Hidden: true,
Usage: "Prepends log messages with call-site location (deprecated)",
Category: flags.DeprecatedCategory,
}
// Deprecated February 2024
MinerNewPayloadTimeoutFlag = &cli.DurationFlag{
Name: "miner.newpayload-timeout",
Hidden: true,
Usage: "Specify the maximum time allowance for creating a new payload (deprecated)",
Value: ethconfig.Defaults.Miner.Recommit,
Category: flags.DeprecatedCategory,
}
MinerEtherbaseFlag = &cli.StringFlag{
Name: "miner.etherbase",
Hidden: true,
Usage: "0x prefixed public address for block mining rewards (deprecated)",
Category: flags.DeprecatedCategory,
}
MiningEnabledFlag = &cli.BoolFlag{
Name: "mine",
Hidden: true,
Usage: "Enable mining (deprecated)",
Category: flags.DeprecatedCategory,
}
MetricsEnabledExpensiveFlag = &cli.BoolFlag{
Name: "metrics.expensive",
Hidden: true,
Usage: "Enable expensive metrics collection and reporting (deprecated)",
Category: flags.DeprecatedCategory,
}
// Deprecated Oct 2024
EnablePersonal = &cli.BoolFlag{
Name: "rpc.enabledeprecatedpersonal",
Hidden: true,
Usage: "This used to enable the 'personal' namespace.",
Category: flags.DeprecatedCategory,
}
UnlockedAccountFlag = &cli.StringFlag{
Name: "unlock",
Hidden: true,
Usage: "Comma separated list of accounts to unlock (deprecated)",
Value: "",
Category: flags.DeprecatedCategory,
}
InsecureUnlockAllowedFlag = &cli.BoolFlag{
Name: "allow-insecure-unlock",
Hidden: true,
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http (deprecated)",
Category: flags.DeprecatedCategory,
}

View file

@ -17,6 +17,13 @@ and `eth_getBlockByNumber`, use this command:
> ./workload test --sepolia --run History/getBlockBy http://host:8545
```
Notably, trace tests require archive which keeps all the historical states for tracing.
The additional flag is required to activate the trace tests.
```
> ./workload test --sepolia --archive --run Trace/Block http://host:8545
```
### Regenerating tests
There is a facility for updating the tests from the chain. This can also be used to
@ -26,5 +33,5 @@ the following commands (in this directory) against a synced mainnet node:
```shell
> go run . filtergen --queries queries/filter_queries_mainnet.json http://host:8545
> go run . historygen --history-tests queries/history_mainnet.json http://host:8545
> go run . tracegen --trace-tests queries/trace_mainnet.json http://host:8545
> go run . tracegen --trace-tests queries/trace_mainnet.json --trace-start 4000000 --trace-end 4000100 http://host:8545
```

View file

@ -21,6 +21,7 @@ import (
"encoding/json"
"fmt"
"math/big"
"os"
"time"
"github.com/ethereum/go-ethereum"
@ -152,9 +153,16 @@ func (s *filterTestSuite) fullRangeQueryAndCheck(t *utesting.T, query *filterQue
func (s *filterTestSuite) loadQueries() error {
file, err := s.cfg.fsys.Open(s.cfg.filterQueryFile)
if err != nil {
// If not found in embedded FS, try to load it from disk
if !os.IsNotExist(err) {
return err
}
file, err = os.OpenFile(s.cfg.filterQueryFile, os.O_RDONLY, 0666)
if err != nil {
return fmt.Errorf("can't open filterQueryFile: %v", err)
}
}
defer file.Close()
var queries [][]*filterQuery

View file

@ -20,6 +20,7 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
@ -51,9 +52,16 @@ func newHistoryTestSuite(cfg testConfig) *historyTestSuite {
func (s *historyTestSuite) loadTests() error {
file, err := s.cfg.fsys.Open(s.cfg.historyTestFile)
if err != nil {
// If not found in embedded FS, try to load it from disk
if !os.IsNotExist(err) {
return err
}
file, err = os.OpenFile(s.cfg.historyTestFile, os.O_RDONLY, 0666)
if err != nil {
return fmt.Errorf("can't open historyTestFile: %v", err)
}
}
defer file.Close()
if err := json.NewDecoder(file).Decode(&s.tests); err != nil {
return fmt.Errorf("invalid JSON in %s: %v", s.cfg.historyTestFile, err)

View file

@ -22,6 +22,7 @@ import (
"fmt"
"math/big"
"os"
"path/filepath"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
@ -137,11 +138,17 @@ func calcReceiptsHash(rcpt []*types.Receipt) common.Hash {
}
func writeJSON(fileName string, value any) {
// Ensure the directory exists
dir := filepath.Dir(fileName)
if err := os.MkdirAll(dir, os.ModePerm); err != nil {
exit(fmt.Errorf("failed to create directories: %w", err))
}
file, err := os.Create(fileName)
if err != nil {
exit(fmt.Errorf("error creating %s: %v", fileName, err))
return
}
defer file.Close()
json.NewEncoder(file).Encode(value)
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -130,18 +130,42 @@ func testConfigFromCLI(ctx *cli.Context) (cfg testConfig) {
switch {
case ctx.Bool(testMainnetFlag.Name):
cfg.fsys = builtinTestFiles
if ctx.IsSet(filterQueryFileFlag.Name) {
cfg.filterQueryFile = ctx.String(filterQueryFileFlag.Name)
} else {
cfg.filterQueryFile = "queries/filter_queries_mainnet.json"
}
if ctx.IsSet(historyTestFileFlag.Name) {
cfg.historyTestFile = ctx.String(historyTestFileFlag.Name)
} else {
cfg.historyTestFile = "queries/history_mainnet.json"
}
if ctx.IsSet(traceTestFileFlag.Name) {
cfg.traceTestFile = ctx.String(traceTestFileFlag.Name)
} else {
cfg.traceTestFile = "queries/trace_mainnet.json"
}
cfg.historyPruneBlock = new(uint64)
*cfg.historyPruneBlock = history.PrunePoints[params.MainnetGenesisHash].BlockNumber
cfg.traceTestFile = "queries/trace_mainnet.json"
case ctx.Bool(testSepoliaFlag.Name):
cfg.fsys = builtinTestFiles
if ctx.IsSet(filterQueryFileFlag.Name) {
cfg.filterQueryFile = ctx.String(filterQueryFileFlag.Name)
} else {
cfg.filterQueryFile = "queries/filter_queries_sepolia.json"
}
if ctx.IsSet(historyTestFileFlag.Name) {
cfg.historyTestFile = ctx.String(historyTestFileFlag.Name)
} else {
cfg.historyTestFile = "queries/history_sepolia.json"
}
if ctx.IsSet(traceTestFileFlag.Name) {
cfg.traceTestFile = ctx.String(traceTestFileFlag.Name)
} else {
cfg.traceTestFile = "queries/trace_sepolia.json"
}
cfg.historyPruneBlock = new(uint64)
*cfg.historyPruneBlock = history.PrunePoints[params.SepoliaGenesisHash].BlockNumber
cfg.traceTestFile = "queries/trace_sepolia.json"
default:
cfg.fsys = os.DirFS(".")
cfg.filterQueryFile = ctx.String(filterQueryFileFlag.Name)

View file

@ -33,7 +33,7 @@ import (
// traceTest is the content of a history test.
type traceTest struct {
TxHashes []common.Hash `json:"txHashes"`
BlockHashes []common.Hash `json:"blockHashes"`
TraceConfigs []tracers.TraceConfig `json:"traceConfigs"`
ResultHashes []common.Hash `json:"resultHashes"`
}
@ -57,15 +57,21 @@ func newTraceTestSuite(cfg testConfig, ctx *cli.Context) *traceTestSuite {
func (s *traceTestSuite) loadTests() error {
file, err := s.cfg.fsys.Open(s.cfg.traceTestFile)
if err != nil {
// If not found in embedded FS, try to load it from disk
if !os.IsNotExist(err) {
return err
}
file, err = os.OpenFile(s.cfg.traceTestFile, os.O_RDONLY, 0666)
if err != nil {
return fmt.Errorf("can't open traceTestFile: %v", err)
}
}
defer file.Close()
if err := json.NewDecoder(file).Decode(&s.tests); err != nil {
return fmt.Errorf("invalid JSON in %s: %v", s.cfg.traceTestFile, err)
}
if len(s.tests.TxHashes) == 0 {
if len(s.tests.BlockHashes) == 0 {
return fmt.Errorf("traceTestFile %s has no test data", s.cfg.traceTestFile)
}
return nil
@ -73,17 +79,17 @@ func (s *traceTestSuite) loadTests() error {
func (s *traceTestSuite) allTests() []workloadTest {
return []workloadTest{
newArchiveWorkloadTest("Trace/Transaction", s.traceTransaction),
newArchiveWorkloadTest("Trace/Block", s.traceBlock),
}
}
// traceTransaction runs all transaction tracing tests
func (s *traceTestSuite) traceTransaction(t *utesting.T) {
// traceBlock runs all block tracing tests
func (s *traceTestSuite) traceBlock(t *utesting.T) {
ctx := context.Background()
for i, hash := range s.tests.TxHashes {
for i, hash := range s.tests.BlockHashes {
config := s.tests.TraceConfigs[i]
result, err := s.cfg.client.Geth.TraceTransaction(ctx, hash, &config)
result, err := s.cfg.client.Geth.TraceBlock(ctx, hash, &config)
if err != nil {
t.Fatalf("Transaction %d (hash %v): error %v", i, hash, err)
}

View file

@ -36,8 +36,6 @@ import (
)
var (
defaultBlocksToTrace = 64 // the number of states assumed to be available
traceGenerateCommand = &cli.Command{
Name: "tracegen",
Usage: "Generates tests for state tracing",
@ -46,7 +44,8 @@ var (
Flags: []cli.Flag{
traceTestFileFlag,
traceTestResultOutputFlag,
traceTestBlockFlag,
traceTestStartBlockFlag,
traceTestEndBlockFlag,
},
}
@ -58,14 +57,18 @@ var (
}
traceTestResultOutputFlag = &cli.StringFlag{
Name: "trace-output",
Usage: "Folder containing the trace output files",
Usage: "Folder containing detailed trace output files",
Value: "",
Category: flags.TestingCategory,
}
traceTestBlockFlag = &cli.IntFlag{
Name: "trace-blocks",
Usage: "The number of blocks for tracing",
Value: defaultBlocksToTrace,
traceTestStartBlockFlag = &cli.IntFlag{
Name: "trace-start",
Usage: "The number of starting block for tracing (included)",
Category: flags.TestingCategory,
}
traceTestEndBlockFlag = &cli.IntFlag{
Name: "trace-end",
Usage: "The number of ending block for tracing (excluded)",
Category: flags.TestingCategory,
}
traceTestInvalidOutputFlag = &cli.StringFlag{
@ -81,21 +84,22 @@ func generateTraceTests(clictx *cli.Context) error {
client = makeClient(clictx)
outputFile = clictx.String(traceTestFileFlag.Name)
outputDir = clictx.String(traceTestResultOutputFlag.Name)
blocks = clictx.Int(traceTestBlockFlag.Name)
startBlock = clictx.Int(traceTestStartBlockFlag.Name)
endBlock = clictx.Int(traceTestEndBlockFlag.Name)
ctx = context.Background()
test = new(traceTest)
)
if outputDir != "" {
err := os.MkdirAll(outputDir, os.ModePerm)
if err != nil {
return err
}
}
latest, err := client.Eth.BlockNumber(ctx)
if err != nil {
exit(err)
}
if latest < uint64(blocks) {
if startBlock > endBlock {
exit(fmt.Errorf("invalid block range for tracing, start: %d, end: %d", startBlock, endBlock))
}
if endBlock-startBlock == 0 {
exit(fmt.Errorf("invalid block range for tracing, start: %d, end: %d", startBlock, endBlock))
}
if latest < uint64(startBlock) || latest < uint64(endBlock) {
exit(fmt.Errorf("node seems not synced, latest block is %d", latest))
}
// Get blocks and assign block info into the test
@ -104,37 +108,35 @@ func generateTraceTests(clictx *cli.Context) error {
logged = time.Now()
failed int
)
log.Info("Trace transactions around the chain tip", "head", latest, "blocks", blocks)
log.Info("Trace transactions around the chain tip", "head", latest, "start", startBlock, "end", endBlock)
for i := 0; i < blocks; i++ {
number := latest - uint64(i)
block, err := client.Eth.BlockByNumber(ctx, big.NewInt(int64(number)))
for i := startBlock; i < endBlock; i++ {
header, err := client.Eth.HeaderByNumber(ctx, big.NewInt(int64(i)))
if err != nil {
exit(err)
}
for _, tx := range block.Transactions() {
config, configName := randomTraceOption()
result, err := client.Geth.TraceTransaction(ctx, tx.Hash(), config)
result, err := client.Geth.TraceBlock(ctx, header.Hash(), config)
if err != nil {
failed += 1
break
continue
}
blob, err := json.Marshal(result)
if err != nil {
failed += 1
break
continue
}
test.TxHashes = append(test.TxHashes, tx.Hash())
test.BlockHashes = append(test.BlockHashes, header.Hash())
test.TraceConfigs = append(test.TraceConfigs, *config)
test.ResultHashes = append(test.ResultHashes, crypto.Keccak256Hash(blob))
writeTraceResult(outputDir, tx.Hash(), result, configName)
}
writeTraceResult(outputDir, header.Hash(), result, configName)
if time.Since(logged) > time.Second*8 {
logged = time.Now()
log.Info("Tracing transactions", "executed", len(test.TxHashes), "failed", failed, "elapsed", common.PrettyDuration(time.Since(start)))
log.Info("Tracing blocks", "executed", len(test.BlockHashes), "failed", failed, "elapsed", common.PrettyDuration(time.Since(start)))
}
}
log.Info("Traced transactions", "executed", len(test.TxHashes), "failed", failed, "elapsed", common.PrettyDuration(time.Since(start)))
log.Info("Traced blocks", "executed", len(test.BlockHashes), "failed", failed, "elapsed", common.PrettyDuration(time.Since(start)))
// Write output file.
writeJSON(outputFile, test)
@ -142,24 +144,15 @@ func generateTraceTests(clictx *cli.Context) error {
}
func randomTraceOption() (*tracers.TraceConfig, string) {
x := rand.Intn(11)
x := rand.Intn(10)
if x == 0 {
// struct-logger, with all fields enabled, very heavy
return &tracers.TraceConfig{
Config: &logger.Config{
EnableMemory: true,
EnableReturnData: true,
},
}, "structAll"
}
if x == 1 {
// default options for struct-logger, with stack and storage capture
// enabled
return &tracers.TraceConfig{
Config: &logger.Config{},
}, "structDefault"
}
if x == 2 || x == 3 || x == 4 {
if x >= 1 && x <= 3 {
// struct-logger with storage capture enabled
return &tracers.TraceConfig{
Config: &logger.Config{
@ -170,14 +163,18 @@ func randomTraceOption() (*tracers.TraceConfig, string) {
// Native tracer
loggers := []string{"callTracer", "4byteTracer", "flatCallTracer", "muxTracer", "noopTracer", "prestateTracer"}
return &tracers.TraceConfig{
Tracer: &loggers[x-5],
}, loggers[x-5]
Tracer: &loggers[x-4],
}, loggers[x-4]
}
func writeTraceResult(dir string, hash common.Hash, result any, configName string) {
if dir == "" {
return
}
// Ensure the directory exists
if err := os.MkdirAll(dir, os.ModePerm); err != nil {
exit(fmt.Errorf("failed to create directories: %w", err))
}
name := filepath.Join(dir, configName+"_"+hash.String())
file, err := os.Create(name)
if err != nil {

View file

@ -71,11 +71,30 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
parentExcessBlobGas = *parent.ExcessBlobGas
parentBlobGasUsed = *parent.BlobGasUsed
}
excessBlobGas := parentExcessBlobGas + parentBlobGasUsed
targetGas := uint64(targetBlobsPerBlock(config, headTimestamp)) * params.BlobTxBlobGasPerBlob
var (
excessBlobGas = parentExcessBlobGas + parentBlobGasUsed
target = targetBlobsPerBlock(config, headTimestamp)
targetGas = uint64(target) * params.BlobTxBlobGasPerBlob
)
if excessBlobGas < targetGas {
return 0
}
if !config.IsOsaka(config.LondonBlock, headTimestamp) {
// Pre-Osaka, we use the formula defined by EIP-4844.
return excessBlobGas - targetGas
}
// EIP-7918 (post-Osaka) introduces a different formula for computing excess.
var (
baseCost = big.NewInt(params.BlobBaseCost)
reservePrice = baseCost.Mul(baseCost, parent.BaseFee)
blobPrice = calcBlobPrice(config, parent)
)
if reservePrice.Cmp(blobPrice) > 0 {
max := MaxBlobsPerBlock(config, headTimestamp)
scaledExcess := parentBlobGasUsed * uint64(max-target) / uint64(max)
return parentExcessBlobGas + scaledExcess
}
return excessBlobGas - targetGas
}
@ -177,3 +196,9 @@ func fakeExponential(factor, numerator, denominator *big.Int) *big.Int {
}
return output.Div(output, denominator)
}
// calcBlobPrice calculates the blob price for a block.
func calcBlobPrice(config *params.ChainConfig, header *types.Header) *big.Int {
blobBaseFee := CalcBlobFee(config, header)
return new(big.Int).Mul(blobBaseFee, big.NewInt(params.BlobTxBlobGasPerBlob))
}

View file

@ -127,3 +127,43 @@ func TestFakeExponential(t *testing.T) {
}
}
}
func TestCalcExcessBlobGasEIP7918(t *testing.T) {
var (
cfg = params.MergedTestChainConfig
targetBlobs = targetBlobsPerBlock(cfg, *cfg.CancunTime)
blobGasTarget = uint64(targetBlobs) * params.BlobTxBlobGasPerBlob
)
makeHeader := func(parentExcess, parentBaseFee uint64, blobsUsed int) *types.Header {
blobGasUsed := uint64(blobsUsed) * params.BlobTxBlobGasPerBlob
return &types.Header{
BaseFee: big.NewInt(int64(parentBaseFee)),
ExcessBlobGas: &parentExcess,
BlobGasUsed: &blobGasUsed,
}
}
tests := []struct {
name string
header *types.Header
wantExcessGas uint64
}{
{
name: "BelowReservePrice",
header: makeHeader(0, 1_000_000_000, targetBlobs),
wantExcessGas: blobGasTarget * 3 / 9,
},
{
name: "AboveReservePrice",
header: makeHeader(0, 1, targetBlobs),
wantExcessGas: 0,
},
}
for _, tc := range tests {
got := CalcExcessBlobGas(cfg, tc.header, *cfg.CancunTime)
if got != tc.wantExcessGas {
t.Fatalf("%s: excess-blob-gas mismatch have %d, want %d",
tc.name, got, tc.wantExcessGas)
}
}
}

View file

@ -49,6 +49,10 @@ func NewBlockValidator(config *params.ChainConfig, blockchain *BlockChain) *Bloc
// header's transaction and uncle roots. The headers are assumed to be already
// validated at this point.
func (v *BlockValidator) ValidateBody(block *types.Block) error {
// check EIP 7934 RLP-encoded block size cap
if v.config.IsOsaka(block.Number(), block.Time()) && block.Size() > params.MaxBlockSize {
return ErrBlockOversized
}
// Check whether the block is already imported.
if v.bc.HasBlockAndState(block.Hash(), block.NumberU64()) {
return ErrKnownBlock

View file

@ -28,6 +28,10 @@ var (
// ErrNoGenesis is returned when there is no Genesis Block.
ErrNoGenesis = errors.New("genesis not found in chain")
// ErrBlockOversized is returned if the size of the RLP-encoded block
// exceeds the cap established by EIP 7934
ErrBlockOversized = errors.New("block RLP-encoded size exceeds maximum")
)
// List of evm-call-message pre-checking errors. All state transition messages will
@ -122,6 +126,9 @@ var (
// Message validation errors:
ErrEmptyAuthList = errors.New("EIP-7702 transaction with empty auth list")
ErrSetCodeTxCreate = errors.New("EIP-7702 transaction cannot be used to create contract")
// -- EIP-7825 errors --
ErrGasLimitTooHigh = errors.New("transaction gas limit too high")
)
// EIP-7702 state transition errors.

View file

@ -185,11 +185,14 @@ type filterMapsRange struct {
initialized bool
headIndexed bool
headDelimiter uint64 // zero if headIndexed is false
// if initialized then all maps are rendered in the maps range
maps common.Range[uint32]
// if tailPartialEpoch > 0 then maps between firstRenderedMap-mapsPerEpoch and
// firstRenderedMap-mapsPerEpoch+tailPartialEpoch-1 are rendered
tailPartialEpoch uint32
// if initialized then all log values in the blocks range are fully
// rendered
// blockLvPointers are available in the blocks range
@ -223,13 +226,15 @@ type Config struct {
}
// NewFilterMaps creates a new FilterMaps and starts the indexer.
func NewFilterMaps(db ethdb.KeyValueStore, initView *ChainView, historyCutoff, finalBlock uint64, params Params, config Config) *FilterMaps {
func NewFilterMaps(db ethdb.KeyValueStore, initView *ChainView, historyCutoff, finalBlock uint64, params Params, config Config) (*FilterMaps, error) {
rs, initialized, err := rawdb.ReadFilterMapsRange(db)
if err != nil || (initialized && rs.Version != databaseVersion) {
rs, initialized = rawdb.FilterMapsRange{}, false
log.Warn("Invalid log index database version; resetting log index")
}
params.deriveFields()
if err := params.sanitize(); err != nil {
return nil, err
}
f := &FilterMaps{
db: db,
closeCh: make(chan struct{}),
@ -254,7 +259,6 @@ func NewFilterMaps(db ethdb.KeyValueStore, initView *ChainView, historyCutoff, f
},
// deleting last unindexed epoch might have been interrupted by shutdown
cleanedEpochsBefore: max(rs.MapsFirst>>params.logMapsPerEpoch, 1) - 1,
historyCutoff: historyCutoff,
finalBlock: finalBlock,
matcherSyncCh: make(chan *FilterMapsMatcherBackend),
@ -272,7 +276,7 @@ func NewFilterMaps(db ethdb.KeyValueStore, initView *ChainView, historyCutoff, f
"firstmap", f.indexedRange.maps.First(), "lastmap", f.indexedRange.maps.Last(),
"headindexed", f.indexedRange.headIndexed)
}
return f
return f, nil
}
// Start starts the indexer.
@ -399,7 +403,7 @@ func (f *FilterMaps) init() error {
batch := f.db.NewBatch()
for epoch := range bestLen {
cp := checkpoints[bestIdx][epoch]
f.storeLastBlockOfMap(batch, (uint32(epoch+1)<<f.logMapsPerEpoch)-1, cp.BlockNumber, cp.BlockId)
f.storeLastBlockOfMap(batch, f.lastEpochMap(uint32(epoch)), cp.BlockNumber, cp.BlockId)
f.storeBlockLvPointer(batch, cp.BlockNumber, cp.FirstIndex)
}
fmr := filterMapsRange{
@ -408,7 +412,7 @@ func (f *FilterMaps) init() error {
if bestLen > 0 {
cp := checkpoints[bestIdx][bestLen-1]
fmr.blocks = common.NewRange(cp.BlockNumber+1, 0)
fmr.maps = common.NewRange(uint32(bestLen)<<f.logMapsPerEpoch, 0)
fmr.maps = common.NewRange(f.firstEpochMap(uint32(bestLen)), 0)
}
f.setRange(batch, f.targetView, fmr, false)
return batch.Write()
@ -578,9 +582,11 @@ func (f *FilterMaps) getFilterMapRows(mapIndices []uint32, rowIndex uint32, base
rows := make([]FilterRow, len(mapIndices))
var ptr int
for len(mapIndices) > ptr {
baseRowGroup := mapIndices[ptr] / f.baseRowGroupLength
groupLength := 1
for ptr+groupLength < len(mapIndices) && mapIndices[ptr+groupLength]/f.baseRowGroupLength == baseRowGroup {
var (
groupIndex = f.mapGroupIndex(mapIndices[ptr])
groupLength = 1
)
for ptr+groupLength < len(mapIndices) && f.mapGroupIndex(mapIndices[ptr+groupLength]) == groupIndex {
groupLength++
}
if err := f.getFilterMapRowsOfGroup(rows[ptr:ptr+groupLength], mapIndices[ptr:ptr+groupLength], rowIndex, baseLayerOnly); err != nil {
@ -594,17 +600,19 @@ func (f *FilterMaps) getFilterMapRows(mapIndices []uint32, rowIndex uint32, base
// getFilterMapRowsOfGroup fetches a set of filter map rows at map indices
// belonging to the same base row group.
func (f *FilterMaps) getFilterMapRowsOfGroup(target []FilterRow, mapIndices []uint32, rowIndex uint32, baseLayerOnly bool) error {
baseRowGroup := mapIndices[0] / f.baseRowGroupLength
baseMapRowIndex := f.mapRowIndex(baseRowGroup*f.baseRowGroupLength, rowIndex)
baseRows, err := rawdb.ReadFilterMapBaseRows(f.db, baseMapRowIndex, f.baseRowGroupLength, f.logMapWidth)
var (
groupIndex = f.mapGroupIndex(mapIndices[0])
mapRowIndex = f.mapRowIndex(groupIndex, rowIndex)
)
baseRows, err := rawdb.ReadFilterMapBaseRows(f.db, mapRowIndex, f.baseRowGroupSize, f.logMapWidth)
if err != nil {
return fmt.Errorf("failed to retrieve base row group %d of row %d: %v", baseRowGroup, rowIndex, err)
return fmt.Errorf("failed to retrieve base row group %d of row %d: %v", groupIndex, rowIndex, err)
}
for i, mapIndex := range mapIndices {
if mapIndex/f.baseRowGroupLength != baseRowGroup {
panic("mapIndices are not in the same base row group")
if f.mapGroupIndex(mapIndex) != groupIndex {
return fmt.Errorf("maps are not in the same base row group, index: %d, group: %d", mapIndex, groupIndex)
}
row := baseRows[mapIndex&(f.baseRowGroupLength-1)]
row := baseRows[f.mapGroupOffset(mapIndex)]
if !baseLayerOnly {
extRow, err := rawdb.ReadFilterMapExtRow(f.db, f.mapRowIndex(mapIndex, rowIndex), f.logMapWidth)
if err != nil {
@ -621,15 +629,17 @@ func (f *FilterMaps) getFilterMapRowsOfGroup(target []FilterRow, mapIndices []ui
// indices and a shared row index.
func (f *FilterMaps) storeFilterMapRows(batch ethdb.Batch, mapIndices []uint32, rowIndex uint32, rows []FilterRow) error {
for len(mapIndices) > 0 {
baseRowGroup := mapIndices[0] / f.baseRowGroupLength
groupLength := 1
for groupLength < len(mapIndices) && mapIndices[groupLength]/f.baseRowGroupLength == baseRowGroup {
groupLength++
var (
pos = 1
groupIndex = f.mapGroupIndex(mapIndices[0])
)
for pos < len(mapIndices) && f.mapGroupIndex(mapIndices[pos]) == groupIndex {
pos++
}
if err := f.storeFilterMapRowsOfGroup(batch, mapIndices[:groupLength], rowIndex, rows[:groupLength]); err != nil {
if err := f.storeFilterMapRowsOfGroup(batch, mapIndices[:pos], rowIndex, rows[:pos]); err != nil {
return err
}
mapIndices, rows = mapIndices[groupLength:], rows[groupLength:]
mapIndices, rows = mapIndices[pos:], rows[pos:]
}
return nil
}
@ -637,21 +647,23 @@ func (f *FilterMaps) storeFilterMapRows(batch ethdb.Batch, mapIndices []uint32,
// storeFilterMapRowsOfGroup stores a set of filter map rows at map indices
// belonging to the same base row group.
func (f *FilterMaps) storeFilterMapRowsOfGroup(batch ethdb.Batch, mapIndices []uint32, rowIndex uint32, rows []FilterRow) error {
baseRowGroup := mapIndices[0] / f.baseRowGroupLength
baseMapRowIndex := f.mapRowIndex(baseRowGroup*f.baseRowGroupLength, rowIndex)
var baseRows [][]uint32
if uint32(len(mapIndices)) != f.baseRowGroupLength { // skip base rows read if all rows are replaced
var (
baseRows [][]uint32
groupIndex = f.mapGroupIndex(mapIndices[0])
mapRowIndex = f.mapRowIndex(groupIndex, rowIndex)
)
if uint32(len(mapIndices)) != f.baseRowGroupSize { // skip base rows read if all rows are replaced
var err error
baseRows, err = rawdb.ReadFilterMapBaseRows(f.db, baseMapRowIndex, f.baseRowGroupLength, f.logMapWidth)
baseRows, err = rawdb.ReadFilterMapBaseRows(f.db, mapRowIndex, f.baseRowGroupSize, f.logMapWidth)
if err != nil {
return fmt.Errorf("failed to retrieve base row group %d of row %d for modification: %v", baseRowGroup, rowIndex, err)
return fmt.Errorf("failed to retrieve filter map %d base rows %d for modification: %v", groupIndex, rowIndex, err)
}
} else {
baseRows = make([][]uint32, f.baseRowGroupLength)
baseRows = make([][]uint32, f.baseRowGroupSize)
}
for i, mapIndex := range mapIndices {
if mapIndex/f.baseRowGroupLength != baseRowGroup {
panic("mapIndices are not in the same base row group")
if f.mapGroupIndex(mapIndex) != groupIndex {
return fmt.Errorf("maps are not in the same base row group, index: %d, group: %d", mapIndex, groupIndex)
}
baseRow := []uint32(rows[i])
var extRow FilterRow
@ -659,10 +671,10 @@ func (f *FilterMaps) storeFilterMapRowsOfGroup(batch ethdb.Batch, mapIndices []u
extRow = baseRow[f.baseRowLength:]
baseRow = baseRow[:f.baseRowLength]
}
baseRows[mapIndex&(f.baseRowGroupLength-1)] = baseRow
baseRows[f.mapGroupOffset(mapIndex)] = baseRow
rawdb.WriteFilterMapExtRow(batch, f.mapRowIndex(mapIndex, rowIndex), extRow, f.logMapWidth)
}
rawdb.WriteFilterMapBaseRows(batch, baseMapRowIndex, baseRows, f.logMapWidth)
rawdb.WriteFilterMapBaseRows(batch, mapRowIndex, baseRows, f.logMapWidth)
return nil
}
@ -747,12 +759,12 @@ func (f *FilterMaps) deleteTailEpoch(epoch uint32) (bool, error) {
defer f.indexLock.Unlock()
// determine epoch boundaries
firstMap := epoch << f.logMapsPerEpoch
lastBlock, _, err := f.getLastBlockOfMap(firstMap + f.mapsPerEpoch - 1)
lastBlock, _, err := f.getLastBlockOfMap(f.lastEpochMap(epoch))
if err != nil {
return false, fmt.Errorf("failed to retrieve last block of deleted epoch %d: %v", epoch, err)
}
var firstBlock uint64
firstMap := f.firstEpochMap(epoch)
if epoch > 0 {
firstBlock, _, err = f.getLastBlockOfMap(firstMap - 1)
if err != nil {
@ -763,8 +775,8 @@ func (f *FilterMaps) deleteTailEpoch(epoch uint32) (bool, error) {
// update rendered range if necessary
var (
fmr = f.indexedRange
firstEpoch = f.indexedRange.maps.First() >> f.logMapsPerEpoch
afterLastEpoch = (f.indexedRange.maps.AfterLast() + f.mapsPerEpoch - 1) >> f.logMapsPerEpoch
firstEpoch = f.mapEpoch(f.indexedRange.maps.First())
afterLastEpoch = f.mapEpoch(f.indexedRange.maps.AfterLast() + f.mapsPerEpoch - 1)
)
if f.indexedRange.tailPartialEpoch != 0 && firstEpoch > 0 {
firstEpoch--
@ -776,7 +788,7 @@ func (f *FilterMaps) deleteTailEpoch(epoch uint32) (bool, error) {
// first fully or partially rendered epoch and there is at least one
// rendered map in the next epoch; remove from indexed range
fmr.tailPartialEpoch = 0
fmr.maps.SetFirst((epoch + 1) << f.logMapsPerEpoch)
fmr.maps.SetFirst(f.firstEpochMap(epoch + 1))
fmr.blocks.SetFirst(lastBlock + 1)
f.setRange(f.db, f.indexedView, fmr, false)
default:
@ -857,7 +869,7 @@ func (f *FilterMaps) exportCheckpoints() {
w.WriteString("[\n")
comma := ","
for epoch := uint32(0); epoch < epochCount; epoch++ {
lastBlock, lastBlockId, err := f.getLastBlockOfMap((epoch+1)<<f.logMapsPerEpoch - 1)
lastBlock, lastBlockId, err := f.getLastBlockOfMap(f.lastEpochMap(epoch))
if err != nil {
log.Error("Error fetching last block of epoch", "epoch", epoch, "error", err)
return

View file

@ -281,7 +281,7 @@ func (f *FilterMaps) tryIndexHead() error {
// is changed.
func (f *FilterMaps) tryIndexTail() (bool, error) {
for {
firstEpoch := f.indexedRange.maps.First() >> f.logMapsPerEpoch
firstEpoch := f.mapEpoch(f.indexedRange.maps.First())
if firstEpoch == 0 || !f.needTailEpoch(firstEpoch-1) {
break
}
@ -359,7 +359,7 @@ func (f *FilterMaps) tryIndexTail() (bool, error) {
// Note that unindexing is very quick as it only removes continuous ranges of
// data from the database and is also called while running head indexing.
func (f *FilterMaps) tryUnindexTail() (bool, error) {
firstEpoch := f.indexedRange.maps.First() >> f.logMapsPerEpoch
firstEpoch := f.mapEpoch(f.indexedRange.maps.First())
if f.indexedRange.tailPartialEpoch > 0 && firstEpoch > 0 {
firstEpoch--
}
@ -392,11 +392,11 @@ func (f *FilterMaps) tryUnindexTail() (bool, error) {
// needTailEpoch returns true if the given tail epoch needs to be kept
// according to the current tail target, false if it can be removed.
func (f *FilterMaps) needTailEpoch(epoch uint32) bool {
firstEpoch := f.indexedRange.maps.First() >> f.logMapsPerEpoch
firstEpoch := f.mapEpoch(f.indexedRange.maps.First())
if epoch > firstEpoch {
return true
}
if (epoch+1)<<f.logMapsPerEpoch >= f.indexedRange.maps.AfterLast() {
if f.firstEpochMap(epoch+1) >= f.indexedRange.maps.AfterLast() {
return true
}
if epoch+1 < firstEpoch {
@ -405,7 +405,7 @@ func (f *FilterMaps) needTailEpoch(epoch uint32) bool {
var lastBlockOfPrevEpoch uint64
if epoch > 0 {
var err error
lastBlockOfPrevEpoch, _, err = f.getLastBlockOfMap(epoch<<f.logMapsPerEpoch - 1)
lastBlockOfPrevEpoch, _, err = f.getLastBlockOfMap(f.lastEpochMap(epoch - 1))
if err != nil {
log.Error("Could not get last block of previous epoch", "epoch", epoch-1, "error", err)
return epoch >= firstEpoch
@ -414,7 +414,7 @@ func (f *FilterMaps) needTailEpoch(epoch uint32) bool {
if f.historyCutoff > lastBlockOfPrevEpoch {
return false
}
lastBlockOfEpoch, _, err := f.getLastBlockOfMap((epoch+1)<<f.logMapsPerEpoch - 1)
lastBlockOfEpoch, _, err := f.getLastBlockOfMap(f.lastEpochMap(epoch))
if err != nil {
log.Error("Could not get last block of epoch", "epoch", epoch, "error", err)
return epoch >= firstEpoch

View file

@ -41,7 +41,7 @@ var testParams = Params{
logMapWidth: 24,
logMapsPerEpoch: 4,
logValuesPerMap: 4,
baseRowGroupLength: 4,
baseRowGroupSize: 4,
baseRowLengthRatio: 2,
logLayerDiff: 2,
}
@ -370,7 +370,7 @@ func (ts *testSetup) setHistory(history uint64, noHistory bool) {
History: history,
Disabled: noHistory,
}
ts.fm = NewFilterMaps(ts.db, view, 0, 0, ts.params, config)
ts.fm, _ = NewFilterMaps(ts.db, view, 0, 0, ts.params, config)
ts.fm.testDisableSnapshots = ts.testDisableSnapshots
ts.fm.Start()
}

View file

@ -284,7 +284,7 @@ func (r *mapRenderer) run(stopCb func() bool, writeCb func()) (bool, error) {
// map finished
r.finishedMaps[r.currentMap.mapIndex] = r.currentMap
r.finished.SetLast(r.finished.AfterLast())
if len(r.finishedMaps) >= maxMapsPerBatch || r.finished.AfterLast()&(r.f.baseRowGroupLength-1) == 0 {
if len(r.finishedMaps) >= maxMapsPerBatch || r.f.mapGroupOffset(r.finished.AfterLast()) == 0 {
if err := r.writeFinishedMaps(stopCb); err != nil {
return false, err
}

View file

@ -844,7 +844,7 @@ func (m *matchSequenceInstance) dropNext(mapIndex uint32) bool {
// results at mapIndex and mapIndex+1. Note that acquiring nextNextRes may be
// skipped and it can be substituted with an empty list if baseRes has no potential
// matches that could be sequence matched with anything that could be in nextNextRes.
func (params *Params) matchResults(mapIndex uint32, offset uint64, baseRes, nextRes potentialMatches) potentialMatches {
func (p *Params) matchResults(mapIndex uint32, offset uint64, baseRes, nextRes potentialMatches) potentialMatches {
if nextRes == nil || (baseRes != nil && len(baseRes) == 0) {
// if nextRes is a wild card or baseRes is empty then the sequence matcher
// result equals baseRes.
@ -854,7 +854,7 @@ func (params *Params) matchResults(mapIndex uint32, offset uint64, baseRes, next
// if baseRes is a wild card or nextRes is empty then the sequence matcher
// result is the items of nextRes with a negative offset applied.
result := make(potentialMatches, 0, len(nextRes))
min := (uint64(mapIndex) << params.logValuesPerMap) + offset
min := (uint64(mapIndex) << p.logValuesPerMap) + offset
for _, v := range nextRes {
if v >= min {
result = append(result, v-offset)

View file

@ -19,6 +19,7 @@ package filtermaps
import (
"crypto/sha256"
"encoding/binary"
"fmt"
"hash/fnv"
"math"
"sort"
@ -28,19 +29,36 @@ import (
// Params defines the basic parameters of the log index structure.
type Params struct {
logMapHeight uint // log2(mapHeight)
logMapWidth uint // log2(mapWidth)
logMapsPerEpoch uint // log2(mapsPerEpoch)
logValuesPerMap uint // log2(logValuesPerMap)
baseRowLengthRatio uint // baseRowLength / average row length
logLayerDiff uint // maxRowLength log2 growth per layer
// derived fields
mapHeight uint32 // filter map height (number of rows)
mapsPerEpoch uint32 // number of maps in an epoch
logMapHeight uint // The number of bits required to represent the map height
logMapWidth uint // The number of bits required to represent the map width
logMapsPerEpoch uint // The number of bits required to represent the number of maps per epoch
logValuesPerMap uint // The number of bits required to represent the number of log values per map
// baseRowLengthRatio represents the ratio of base row length
// to the average row length.
baseRowLengthRatio uint
// logLayerDiff defines the logarithmic growth factor (base 2) of
// the maximum row length per layer. It indicates how much the maximum
// row length increases as the layer depth increases.
//
// Specifically:
// - the row length in base layer (layer == 0) is baseRowLength
// - the row length in layer x is baseRowLength << (logLayerDiff * x)
logLayerDiff uint
// These fields can be derived with the information above
mapHeight uint32 // The number of rows in the filter map
mapsPerEpoch uint32 // The number of maps in an epoch
valuesPerMap uint64 // The number of log values marked on each filter map
baseRowLength uint32 // maximum number of log values per row on layer 0
valuesPerMap uint64 // number of log values marked on each filter map
// not affecting consensus
baseRowGroupLength uint32 // length of base row groups in local database
// baseRowGroupSize defines the number of base row entries grouped together
// as a single database entry in the local database to optimize storage
// and retrieval efficiency.
//
// This value can be configured based on the specific implementation.
baseRowGroupSize uint32
}
// DefaultParams is the set of parameters used on mainnet.
@ -49,7 +67,7 @@ var DefaultParams = Params{
logMapWidth: 24,
logMapsPerEpoch: 10,
logValuesPerMap: 16,
baseRowGroupLength: 32,
baseRowGroupSize: 32,
baseRowLengthRatio: 8,
logLayerDiff: 4,
}
@ -60,7 +78,7 @@ var RangeTestParams = Params{
logMapWidth: 24,
logMapsPerEpoch: 0,
logValuesPerMap: 0,
baseRowGroupLength: 32,
baseRowGroupSize: 32,
baseRowLengthRatio: 16, // baseRowLength >= 1
logLayerDiff: 4,
}
@ -91,6 +109,44 @@ func topicValue(topic common.Hash) common.Hash {
return result
}
// sanitize derives any missing fields and validates the parameter values.
func (p *Params) sanitize() error {
p.deriveFields()
if p.logMapWidth%8 != 0 {
return fmt.Errorf("invalid configuration: logMapWidth (%d) must be a multiple of 8", p.logMapWidth)
}
if p.baseRowGroupSize == 0 || (p.baseRowGroupSize&(p.baseRowGroupSize-1)) != 0 {
return fmt.Errorf("invalid configuration: baseRowGroupSize (%d) must be a power of 2", p.baseRowGroupSize)
}
return nil
}
// mapGroupIndex returns the start index of the base row group that contains the
// given map index. Assumes baseRowGroupSize is a power of 2.
func (p *Params) mapGroupIndex(index uint32) uint32 {
return index & ^(p.baseRowGroupSize - 1)
}
// mapGroupOffset returns the offset of the given map index within its base row group.
func (p *Params) mapGroupOffset(index uint32) uint32 {
return index & (p.baseRowGroupSize - 1)
}
// mapEpoch returns the epoch number that the given map index belongs to.
func (p *Params) mapEpoch(index uint32) uint32 {
return index >> p.logMapsPerEpoch
}
// firstEpochMap returns the index of the first map in the specified epoch.
func (p *Params) firstEpochMap(epoch uint32) uint32 {
return epoch << p.logMapsPerEpoch
}
// lastEpochMap returns the index of the last map in the specified epoch.
func (p *Params) lastEpochMap(epoch uint32) uint32 {
return (epoch+1)<<p.logMapsPerEpoch - 1
}
// rowIndex returns the row index in which the given log value should be marked
// on the given map and mapping layer. Note that row assignments are re-shuffled
// with a different frequency on each mapping layer, allowing efficient disk
@ -125,17 +181,20 @@ func (p *Params) columnIndex(lvIndex uint64, logValue *common.Hash) uint32 {
return uint32(lvIndex%p.valuesPerMap)<<hashBits + (uint32(hash>>(64-hashBits)) ^ uint32(hash)>>(32-hashBits))
}
// maxRowLength returns the maximum length filter rows are populated up to
// when using the given mapping layer. A log value can be marked on the map
// according to a given mapping layer if the row mapping on that layer points
// to a row that has not yet reached the maxRowLength belonging to that layer.
// maxRowLength returns the maximum length filter rows are populated up to when
// using the given mapping layer.
//
// A log value can be marked on the map according to a given mapping layer if
// the row mapping on that layer points to a row that has not yet reached the
// maxRowLength belonging to that layer.
//
// This means that a row that is considered full on a given layer may still be
// extended further on a higher order layer.
//
// Each value is marked on the lowest order layer possible, assuming that marks
// are added in ascending log value index order.
// When searching for a log value one should consider all layers and process
// corresponding rows up until the first one where the row mapped to the given
// layer is not full.
// are added in ascending log value index order. When searching for a log value
// one should consider all layers and process corresponding rows up until the
// first one where the row mapped to the given layer is not full.
func (p *Params) maxRowLength(layerIndex uint32) uint32 {
logLayerDiff := uint(layerIndex) * p.logLayerDiff
if logLayerDiff > p.logMapsPerEpoch {

View file

@ -388,7 +388,7 @@ func ReadFilterMapBaseRows(db ethdb.KeyValueReader, mapRowIndex uint64, rowCount
headerBits--
}
if headerLen+byteLength*entryCount > encLen {
return nil, errors.New("Invalid encoded base filter rows length")
return nil, errors.New("invalid encoded base filter rows length")
}
if entriesInRow > 0 {
rows[rowIndex] = make([]uint32, entriesInRow)
@ -405,8 +405,8 @@ func ReadFilterMapBaseRows(db ethdb.KeyValueReader, mapRowIndex uint64, rowCount
return rows, nil
}
// WriteFilterMapExtRow stores a filter map row at the given mapRowIndex or deletes
// any existing entry if the row is empty.
// WriteFilterMapExtRow stores an extended filter map row at the given mapRowIndex
// or deletes any existing entry if the row is empty.
func WriteFilterMapExtRow(db ethdb.KeyValueWriter, mapRowIndex uint64, row []uint32, bitLength uint) {
byteLength := int(bitLength) / 8
if int(bitLength) != byteLength*8 {

View file

@ -125,8 +125,8 @@ var (
StateHistoryIndexPrefix = []byte("m") // The global prefix of state history index data
StateHistoryAccountMetadataPrefix = []byte("ma") // StateHistoryAccountMetadataPrefix + account address hash => account metadata
StateHistoryStorageMetadataPrefix = []byte("ms") // StateHistoryStorageMetadataPrefix + account address hash + storage slot hash => slot metadata
StateHistoryAccountBlockPrefix = []byte("mba") // StateHistoryAccountBlockPrefix + account address hash + block_number => account block
StateHistoryStorageBlockPrefix = []byte("mbs") // StateHistoryStorageBlockPrefix + account address hash + storage slot hash + block_number => slot block
StateHistoryAccountBlockPrefix = []byte("mba") // StateHistoryAccountBlockPrefix + account address hash + blockID => account block
StateHistoryStorageBlockPrefix = []byte("mbs") // StateHistoryStorageBlockPrefix + account address hash + storage slot hash + blockID => slot block
// VerklePrefix is the database prefix for Verkle trie data, which includes:
// (a) Trie nodes

View file

@ -389,6 +389,15 @@ func (s *StateDB) GetCommittedState(addr common.Address, hash common.Hash) commo
return common.Hash{}
}
// GetStateAndCommittedState returns the current value and the original value.
func (s *StateDB) GetStateAndCommittedState(addr common.Address, hash common.Hash) (common.Hash, common.Hash) {
stateObject := s.getStateObject(addr)
if stateObject != nil {
return stateObject.getState(hash)
}
return common.Hash{}, common.Hash{}
}
// Database retrieves the low level database supporting the lower level trie ops.
func (s *StateDB) Database() Database {
return s.db

View file

@ -85,8 +85,8 @@ func (s *hookedStateDB) GetRefund() uint64 {
return s.inner.GetRefund()
}
func (s *hookedStateDB) GetCommittedState(addr common.Address, hash common.Hash) common.Hash {
return s.inner.GetCommittedState(addr, hash)
func (s *hookedStateDB) GetStateAndCommittedState(addr common.Address, hash common.Hash) (common.Hash, common.Hash) {
return s.inner.GetStateAndCommittedState(addr, hash)
}
func (s *hookedStateDB) GetState(addr common.Address, hash common.Hash) common.Hash {

View file

@ -394,6 +394,10 @@ func (st *stateTransition) preCheck() error {
return fmt.Errorf("%w (sender %v)", ErrEmptyAuthList, msg.From)
}
}
// Verify tx gas limit does not exceed EIP-7825 cap.
if st.evm.ChainConfig().IsOsaka(st.evm.Context.BlockNumber, st.evm.Context.Time) && msg.GasLimit > params.MaxTxGas {
return fmt.Errorf("%w (cap: %d, tx: %d)", ErrGasLimitTooHigh, params.MaxTxGas, msg.GasLimit)
}
return st.buyGas()
}

View file

@ -1638,6 +1638,11 @@ func (p *BlobPool) Pending(filter txpool.PendingFilter) map[common.Address][]*tx
break // blobfee too low, cannot be included, discard rest of txs from the account
}
}
if filter.GasLimitCap != 0 {
if tx.execGas > filter.GasLimitCap {
break // execution gas limit is too high
}
}
// Transaction was accepted according to the filter, append to the pending list
lazies = append(lazies, &txpool.LazyTransaction{
Pool: p,

View file

@ -116,7 +116,7 @@ func (l *limbo) finalize(final *types.Header) {
// Just in case there's no final block yet (network not yet merged, weird
// restart, sethead, etc), fail gracefully.
if final == nil {
log.Error("Nil finalized block cannot evict old blobs")
log.Warn("Nil finalized block cannot evict old blobs")
return
}
for block, ids := range l.groups {
@ -139,11 +139,11 @@ func (l *limbo) push(tx *types.Transaction, block uint64) error {
// If the blobs are already tracked by the limbo, consider it a programming
// error. There's not much to do against it, but be loud.
if _, ok := l.index[tx.Hash()]; ok {
log.Error("Limbo cannot push already tracked blobs", "tx", tx)
log.Error("Limbo cannot push already tracked blobs", "tx", tx.Hash())
return errors.New("already tracked blob transaction")
}
if err := l.setAndIndex(tx, block); err != nil {
log.Error("Failed to set and index limboed blobs", "tx", tx, "err", err)
log.Error("Failed to set and index limboed blobs", "tx", tx.Hash(), "err", err)
return err
}
return nil

View file

@ -530,13 +530,21 @@ func (pool *LegacyPool) Pending(filter txpool.PendingFilter) map[common.Address]
txs := list.Flatten()
// If the miner requests tip enforcement, cap the lists now
if minTipBig != nil {
if minTipBig != nil || filter.GasLimitCap != 0 {
for i, tx := range txs {
if minTipBig != nil {
if tx.EffectiveGasTipIntCmp(minTipBig, baseFeeBig) < 0 {
txs = txs[:i]
break
}
}
if filter.GasLimitCap != 0 {
if tx.Gas() > filter.GasLimitCap {
txs = txs[:i]
break
}
}
}
}
if len(txs) > 0 {
lazies := make([]*txpool.LazyTransaction, len(txs))
@ -1255,6 +1263,21 @@ func (pool *LegacyPool) runReorg(done chan struct{}, reset *txpoolResetRequest,
}
pool.mu.Lock()
if reset != nil {
if reset.newHead != nil && reset.oldHead != nil {
// Discard the transactions with the gas limit higher than the cap.
if pool.chainconfig.IsOsaka(reset.newHead.Number, reset.newHead.Time) && !pool.chainconfig.IsOsaka(reset.oldHead.Number, reset.oldHead.Time) {
var hashes []common.Hash
pool.all.Range(func(hash common.Hash, tx *types.Transaction) bool {
if tx.Gas() > params.MaxTxGas {
hashes = append(hashes, hash)
}
return true
})
for _, hash := range hashes {
pool.removeTx(hash, true, true)
}
}
}
// Reset from the old head to the new, rescheduling any reorged transactions
pool.reset(reset.oldHead, reset.newHead)

View file

@ -76,6 +76,7 @@ type PendingFilter struct {
MinTip *uint256.Int // Minimum miner tip required to include a transaction
BaseFee *uint256.Int // Minimum 1559 basefee needed to include a transaction
BlobFee *uint256.Int // Minimum 4844 blobfee needed to include a blob transaction
GasLimitCap uint64 // Maximum gas can be used for a single transaction execution (0 means no limit)
OnlyPlainTxs bool // Return only plain EVM transactions (peer-join announces, block space filling)
OnlyBlobTxs bool // Return only blob transactions (block blob-space filling)

View file

@ -90,6 +90,9 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
if rules.IsShanghai && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
return fmt.Errorf("%w: code size %v, limit %v", core.ErrMaxInitCodeSizeExceeded, len(tx.Data()), params.MaxInitCodeSize)
}
if rules.IsOsaka && tx.Gas() > params.MaxTxGas {
return fmt.Errorf("%w (cap: %d, tx: %d)", core.ErrGasLimitTooHigh, params.MaxTxGas, tx.Gas())
}
// Transactions can't be negative. This may never happen using RLP decoded
// transactions but may occur for transactions created using the RPC.
if tx.Value().Sign() < 0 {

View file

@ -24,11 +24,13 @@ import (
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/blocktest"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/holiman/uint256"
)
// from bcValidBlockTest.json, "SimpleTx"
@ -194,6 +196,60 @@ func TestEIP2718BlockEncoding(t *testing.T) {
}
}
func TestEIP4844BlockEncoding(t *testing.T) {
// https://github.com/ethereum/tests/blob/develop/BlockchainTests/ValidBlocks/bcEIP4844-blobtransactions/blockWithAllTransactionTypes.json
blockEnc := common.FromHex("0xf90417f90244a05eb7f6da0f3e237c62bcae48b7fb5f4506d392616b62890429c8b76b4a1d4104a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794ba5e000000000000000000000000000000000000a011639dcca0b44f2acb5b630a82c8a69cb82742b3711383ec4e111a554d27aea5a05cb644f722e31f9792a8ef6e2a762334e1a862e8b40c1612e1e9507fd7121ef9a00c82719448356ba6807d6edfcd8e5aea575a5e97f36038ffb3e395749b26d41cb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800188016345785d8a00008301482082079e42a00000000000000000000000000000000000000000000000000000000000020000880000000000000000820314a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4218302000080a00000000000000000000000000000000000000000000000000000000000000000f901cbf864808203e885e8d4a5100094100000000000000000000000000000000000000a01801ca09de4adda6288582a6700dbcd8eb70c0a4a7fc9487d965f7bf22424e0bd121095a01cdb078764cc3770d5db847e99e10333aa7c356247baaf09b03eae04d64e7926b86901f86601018203e885e8d4a5100094100000000000000000000000000000000000000a0380c080a025090740da12684493e4fb466a3979e365b194e8cf462edf3c2c3be2f130bb2ea034fa18fb4c1bff4d957d72e28535d27f1352517a942aeaca0ed944085f0cd8bbb86a02f8670102018203e885e8d4a5100094100000000000000000000000000000000000000a0580c080a0352a7be5002ce111bc5167f3addf97a75e2e0b810d826af71d2caae18aed284ea065d38f8a5c8948ce706842e8861fb21020b93a4d5e489162a0e6d419a457b735b88c03f8890103018203e885e8d4a5100094100000000000000000000000000000000000000a0780c00ae1a001a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8809f638144c46d5de7a9e630c0e7c5c63ae829ecfd8cc94715d9c29fe17c464de0a06c5fc54c3aa868ba35ef31a4e12431611631ab7bcdceb4214dd273d83f73b5e1c0c0")
var block Block
if err := rlp.DecodeBytes(blockEnc, &block); err != nil {
t.Fatal("decode error: ", err)
}
check := func(f string, got, want interface{}) {
if !reflect.DeepEqual(got, want) {
t.Errorf("%s mismatch: got %v, want %v", f, got, want)
}
}
check("Difficulty", block.Difficulty(), big.NewInt(0))
check("GasLimit", block.GasLimit(), hexutil.MustDecodeUint64("0x16345785d8a0000"))
check("GasUsed", block.GasUsed(), hexutil.MustDecodeUint64("0x14820"))
check("Coinbase", block.Coinbase(), common.HexToAddress("0xba5e000000000000000000000000000000000000"))
check("MixDigest", block.MixDigest(), common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000020000"))
check("Root", block.Root(), common.HexToHash("0x11639dcca0b44f2acb5b630a82c8a69cb82742b3711383ec4e111a554d27aea5"))
check("WithdrawalRoot", *block.Header().WithdrawalsHash, common.HexToHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"))
check("Nonce", block.Nonce(), uint64(0))
check("Time", block.Time(), hexutil.MustDecodeUint64("0x79e"))
check("Size", block.Size(), uint64(len(blockEnc)))
// Create blob tx.
tx := NewTx(&BlobTx{
ChainID: uint256.NewInt(1),
Nonce: 3,
To: common.HexToAddress("0x100000000000000000000000000000000000000a"),
Gas: hexutil.MustDecodeUint64("0xe8d4a51000"),
GasTipCap: uint256.MustFromHex("0x1"),
GasFeeCap: uint256.MustFromHex("0x3e8"),
BlobFeeCap: uint256.MustFromHex("0xa"),
BlobHashes: []common.Hash{
common.BytesToHash(hexutil.MustDecode("0x01a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8")),
},
Value: uint256.MustFromHex("0x7"),
})
sig := common.Hex2Bytes("00638144c46d5de7a9e630c0e7c5c63ae829ecfd8cc94715d9c29fe17c464de06c5fc54c3aa868ba35ef31a4e12431611631ab7bcdceb4214dd273d83f73b5e100")
tx, _ = tx.WithSignature(LatestSignerForChainID(big.NewInt(1)), sig)
check("len(Transactions)", len(block.Transactions()), 4)
check("Transactions[3].Hash", block.Transactions()[3].Hash(), tx.Hash())
check("Transactions[3].Type()", block.Transactions()[3].Type(), uint8(BlobTxType))
ourBlockEnc, err := rlp.EncodeToBytes(&block)
if err != nil {
t.Fatal("encode error: ", err)
}
if !bytes.Equal(ourBlockEnc, blockEnc) {
t.Errorf("encoded block mismatch:\ngot: %x\nwant: %x", ourBlockEnc, blockEnc)
}
}
func TestUncleHash(t *testing.T) {
uncles := make([]*Header, 0)
h := CalcUncleHash(uncles)

View file

@ -22,7 +22,7 @@ func (l Log) MarshalJSON() ([]byte, error) {
TxHash common.Hash `json:"transactionHash" gencodec:"required" rlp:"-"`
TxIndex hexutil.Uint `json:"transactionIndex" rlp:"-"`
BlockHash common.Hash `json:"blockHash" rlp:"-"`
BlockTimestamp uint64 `json:"blockTimestamp" rlp:"-"`
BlockTimestamp hexutil.Uint64 `json:"blockTimestamp" rlp:"-"`
Index hexutil.Uint `json:"logIndex" rlp:"-"`
Removed bool `json:"removed" rlp:"-"`
}
@ -34,7 +34,7 @@ func (l Log) MarshalJSON() ([]byte, error) {
enc.TxHash = l.TxHash
enc.TxIndex = hexutil.Uint(l.TxIndex)
enc.BlockHash = l.BlockHash
enc.BlockTimestamp = l.BlockTimestamp
enc.BlockTimestamp = hexutil.Uint64(l.BlockTimestamp)
enc.Index = hexutil.Uint(l.Index)
enc.Removed = l.Removed
return json.Marshal(&enc)
@ -50,7 +50,7 @@ func (l *Log) UnmarshalJSON(input []byte) error {
TxHash *common.Hash `json:"transactionHash" gencodec:"required" rlp:"-"`
TxIndex *hexutil.Uint `json:"transactionIndex" rlp:"-"`
BlockHash *common.Hash `json:"blockHash" rlp:"-"`
BlockTimestamp *uint64 `json:"blockTimestamp" rlp:"-"`
BlockTimestamp *hexutil.Uint64 `json:"blockTimestamp" rlp:"-"`
Index *hexutil.Uint `json:"logIndex" rlp:"-"`
Removed *bool `json:"removed" rlp:"-"`
}
@ -84,7 +84,7 @@ func (l *Log) UnmarshalJSON(input []byte) error {
l.BlockHash = *dec.BlockHash
}
if dec.BlockTimestamp != nil {
l.BlockTimestamp = *dec.BlockTimestamp
l.BlockTimestamp = uint64(*dec.BlockTimestamp)
}
if dec.Index != nil {
l.Index = uint(*dec.Index)

View file

@ -59,5 +59,6 @@ type logMarshaling struct {
Data hexutil.Bytes
BlockNumber hexutil.Uint64
TxIndex hexutil.Uint
BlockTimestamp hexutil.Uint64
Index hexutil.Uint
}

View file

@ -449,14 +449,18 @@ func (tx *Transaction) BlobGasFeeCapIntCmp(other *big.Int) int {
// WithoutBlobTxSidecar returns a copy of tx with the blob sidecar removed.
func (tx *Transaction) WithoutBlobTxSidecar() *Transaction {
blobtx, ok := tx.inner.(*BlobTx)
if !ok {
if !ok || blobtx.Sidecar == nil {
return tx
}
cpy := &Transaction{
inner: blobtx.withoutSidecar(),
time: tx.time,
}
// Note: tx.size cache not carried over because the sidecar is included in size!
if size := tx.size.Load(); size != 0 {
// The tx had a sidecar before, so we need to subtract it from the size.
scSize := rlp.ListSize(blobtx.Sidecar.encodedSize())
cpy.size.Store(size - scSize)
}
if h := tx.hash.Load(); h != nil {
cpy.hash.Store(h)
}

View file

@ -35,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/crypto/blake2b"
"github.com/ethereum/go-ethereum/crypto/bn256"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
"github.com/ethereum/go-ethereum/crypto/secp256r1"
"github.com/ethereum/go-ethereum/params"
"golang.org/x/crypto/ripemd160"
)
@ -161,6 +162,14 @@ var PrecompiledContractsOsaka = PrecompiledContracts{
common.BytesToAddress([]byte{0x0f}): &bls12381Pairing{},
common.BytesToAddress([]byte{0x10}): &bls12381MapG1{},
common.BytesToAddress([]byte{0x11}): &bls12381MapG2{},
common.BytesToAddress([]byte{0x1, 0x00}): &p256Verify{},
}
// PrecompiledContractsP256Verify contains the precompiled Ethereum
// contract specified in EIP-7212. This is exported for testing purposes.
var PrecompiledContractsP256Verify = PrecompiledContracts{
common.BytesToAddress([]byte{0x1, 0x00}): &p256Verify{},
}
var (
@ -1232,3 +1241,31 @@ func kZGToVersionedHash(kzg kzg4844.Commitment) common.Hash {
return h
}
// P256VERIFY (secp256r1 signature verification)
// implemented as a native contract
type p256Verify struct{}
// RequiredGas returns the gas required to execute the precompiled contract
func (c *p256Verify) RequiredGas(input []byte) uint64 {
return params.P256VerifyGas
}
// Run executes the precompiled contract with given 160 bytes of param, returning the output and the used gas
func (c *p256Verify) Run(input []byte) ([]byte, error) {
const p256VerifyInputLength = 160
if len(input) != p256VerifyInputLength {
return nil, nil
}
// Extract hash, r, s, x, y from the input.
hash := input[0:32]
r, s := new(big.Int).SetBytes(input[32:64]), new(big.Int).SetBytes(input[64:96])
x, y := new(big.Int).SetBytes(input[96:128]), new(big.Int).SetBytes(input[128:160])
// Verify the signature.
if secp256r1.Verify(hash, r, s, x, y) {
return true32Byte, nil
}
return nil, nil
}

View file

@ -66,6 +66,8 @@ var allPrecompiles = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{0x0f, 0x0e}): &bls12381Pairing{},
common.BytesToAddress([]byte{0x0f, 0x0f}): &bls12381MapG1{},
common.BytesToAddress([]byte{0x0f, 0x10}): &bls12381MapG2{},
common.BytesToAddress([]byte{0x0b}): &p256Verify{},
}
// EIP-152 test vectors
@ -397,3 +399,15 @@ func BenchmarkPrecompiledBLS12381G2MultiExpWorstCase(b *testing.B) {
}
benchmarkPrecompiled("f0d", testcase, b)
}
// Benchmarks the sample inputs from the P256VERIFY precompile.
func BenchmarkPrecompiledP256Verify(bench *testing.B) {
t := precompiledTest{
Input: "4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4da73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d604aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff37618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e",
Expected: "0000000000000000000000000000000000000000000000000000000000000001",
Name: "p256Verify",
}
benchmarkPrecompiled("0b", t, bench)
}
func TestPrecompiledP256Verify(t *testing.T) { testJson("p256Verify", "0b", t) }

View file

@ -41,6 +41,7 @@ var activators = map[int]func(*JumpTable){
1153: enable1153,
4762: enable4762,
7702: enable7702,
7939: enable7939,
}
// EnableEIP enables the given EIP on the config.
@ -293,6 +294,13 @@ func opBlobBaseFee(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
return nil, nil
}
// opCLZ implements the CLZ opcode (count leading zero bytes)
func opCLZ(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
x := scope.Stack.peek()
x.SetUint64(256 - uint64(x.BitLen()))
return nil, nil
}
// enable4844 applies EIP-4844 (BLOBHASH opcode)
func enable4844(jt *JumpTable) {
jt[BLOBHASH] = &operation{
@ -303,6 +311,16 @@ func enable4844(jt *JumpTable) {
}
}
// enable7939 enables EIP-7939 (CLZ opcode)
func enable7939(jt *JumpTable) {
jt[CLZ] = &operation{
execute: opCLZ,
constantGas: GasFastStep,
minStack: minStack(1, 1),
maxStack: maxStack(1, 1),
}
}
// enable7516 applies EIP-7516 (BLOBBASEFEE opcode)
func enable7516(jt *JumpTable) {
jt[BLOBBASEFEE] = &operation{

View file

@ -99,7 +99,7 @@ var (
func gasSStore(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) {
var (
y, x = stack.Back(1), stack.Back(0)
current = evm.StateDB.GetState(contract.Address(), x.Bytes32())
current, original = evm.StateDB.GetStateAndCommittedState(contract.Address(), x.Bytes32())
)
// The legacy gas metering only takes into consideration the current state
// Legacy rules should be applied if we are in Petersburg (removal of EIP-1283)
@ -139,7 +139,6 @@ func gasSStore(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySi
if current == value { // noop (1)
return params.NetSstoreNoopGas, nil
}
original := evm.StateDB.GetCommittedState(contract.Address(), x.Bytes32())
if original == current {
if original == (common.Hash{}) { // create slot (2.1.1)
return params.NetSstoreInitGas, nil
@ -189,14 +188,13 @@ func gasSStoreEIP2200(evm *EVM, contract *Contract, stack *Stack, mem *Memory, m
// Gas sentry honoured, do the actual gas calculation based on the stored value
var (
y, x = stack.Back(1), stack.Back(0)
current = evm.StateDB.GetState(contract.Address(), x.Bytes32())
current, original = evm.StateDB.GetStateAndCommittedState(contract.Address(), x.Bytes32())
)
value := common.Hash(y.Bytes32())
if current == value { // noop (1)
return params.SloadGasEIP2200, nil
}
original := evm.StateDB.GetCommittedState(contract.Address(), x.Bytes32())
if original == current {
if original == (common.Hash{}) { // create slot (2.1.1)
return params.SstoreSetGasEIP2200, nil

View file

@ -972,3 +972,43 @@ func TestPush(t *testing.T) {
}
}
}
func TestOpCLZ(t *testing.T) {
evm := NewEVM(BlockContext{}, nil, params.TestChainConfig, Config{})
tests := []struct {
inputHex string
want uint64 // expected CLZ result
}{
{"0x0", 256},
{"0x1", 255},
{"0x6ff", 245}, // 0x6ff = 0b11011111111 (11 bits), so 256-11 = 245
{"0xffffffffff", 216}, // 40 bits, so 256-40 = 216
{"0x4000000000000000000000000000000000000000000000000000000000000000", 1},
{"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 1},
{"0x8000000000000000000000000000000000000000000000000000000000000000", 0},
{"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 0},
}
for _, tc := range tests {
// prepare a fresh stack and PC
stack := newstack()
pc := uint64(0)
// parse input
val := new(uint256.Int)
if err := val.SetFromHex(tc.inputHex); err != nil {
t.Fatal("invalid hex uint256:", tc.inputHex)
}
stack.push(val)
opCLZ(&pc, evm.interpreter, &ScopeContext{Stack: stack})
if gotLen := stack.len(); gotLen != 1 {
t.Fatalf("stack length = %d; want 1", gotLen)
}
result := stack.pop()
if got := result.Uint64(); got != tc.want {
t.Fatalf("clz(%q) = %d; want %d", tc.inputHex, got, tc.want)
}
}
}

View file

@ -50,7 +50,7 @@ type StateDB interface {
SubRefund(uint64)
GetRefund() uint64
GetCommittedState(common.Address, common.Hash) common.Hash
GetStateAndCommittedState(common.Address, common.Hash) (common.Hash, common.Hash)
GetState(common.Address, common.Hash) common.Hash
SetState(common.Address, common.Hash, common.Hash) common.Hash
GetStorageRoot(addr common.Address) common.Hash

View file

@ -106,6 +106,8 @@ func NewEVMInterpreter(evm *EVM) *EVMInterpreter {
// If jump table was not initialised we set the default one.
var table *JumpTable
switch {
case evm.chainRules.IsOsaka:
table = &osakaInstructionSet
case evm.chainRules.IsVerkle:
// TODO replace with proper instruction set when fork is specified
table = &verkleInstructionSet
@ -182,6 +184,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
var (
op OpCode // current opcode
jumpTable *JumpTable = in.table
mem = NewMemory() // bound memory
stack = newstack() // local stack
callContext = &ScopeContext{
@ -227,6 +230,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
// explicit STOP, RETURN or SELFDESTRUCT is executed, an error occurred during
// the execution of one of the operations or until the done flag is set by the
// parent context.
_ = jumpTable[0] // nil-check the jumpTable out of the loop
for {
if debug {
// Capture pre-execution values for tracing.
@ -247,7 +251,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
// Get the operation from the jump table and validate the stack to ensure there are
// enough stack items available to perform the operation.
op = contract.GetOp(pc)
operation := in.table[op]
operation := jumpTable[op]
cost = operation.constantGas // For tracing
// Validate stack
if sLen := stack.len(); sLen < operation.minStack {

View file

@ -18,6 +18,7 @@ package vm
import (
"math"
"math/big"
"testing"
"time"
@ -74,3 +75,22 @@ func TestLoopInterrupt(t *testing.T) {
}
}
}
func BenchmarkInterpreter(b *testing.B) {
var (
statedb, _ = state.New(types.EmptyRootHash, state.NewDatabaseForTesting())
evm = NewEVM(BlockContext{BlockNumber: big.NewInt(1), Time: 1, Random: &common.Hash{}}, statedb, params.MergedTestChainConfig, Config{})
startGas uint64 = 100_000_000
value = uint256.NewInt(0)
stack = newstack()
mem = NewMemory()
contract = NewContract(common.Address{}, common.Address{}, value, startGas, nil)
)
stack.push(uint256.NewInt(123))
stack.push(uint256.NewInt(123))
gasSStoreEIP3529 = makeGasSStoreFunc(params.SstoreClearsScheduleRefundEIP3529)
b.ResetTimer()
for i := 0; i < b.N; i++ {
gasSStoreEIP3529(evm, contract, stack, mem, 1234)
}
}

View file

@ -62,6 +62,7 @@ var (
cancunInstructionSet = newCancunInstructionSet()
verkleInstructionSet = newVerkleInstructionSet()
pragueInstructionSet = newPragueInstructionSet()
osakaInstructionSet = newOsakaInstructionSet()
)
// JumpTable contains the EVM opcodes supported at a given fork.
@ -91,6 +92,12 @@ func newVerkleInstructionSet() JumpTable {
return validate(instructionSet)
}
func newOsakaInstructionSet() JumpTable {
instructionSet := newPragueInstructionSet()
enable7939(&instructionSet) // EIP-7939 (CLZ opcode)
return validate(instructionSet)
}
func newPragueInstructionSet() JumpTable {
instructionSet := newCancunInstructionSet()
enable7702(&instructionSet) // EIP-7702 Setcode transaction type

View file

@ -29,7 +29,7 @@ func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
case rules.IsVerkle:
return newCancunInstructionSet(), errors.New("verkle-fork not defined yet")
case rules.IsOsaka:
return newPragueInstructionSet(), errors.New("osaka-fork not defined yet")
return newOsakaInstructionSet(), nil
case rules.IsPrague:
return newPragueInstructionSet(), nil
case rules.IsCancun:

View file

@ -62,6 +62,7 @@ const (
SHL OpCode = 0x1b
SHR OpCode = 0x1c
SAR OpCode = 0x1d
CLZ OpCode = 0x1e
)
// 0x20 range - crypto.
@ -282,6 +283,7 @@ var opCodeToString = [256]string{
SHL: "SHL",
SHR: "SHR",
SAR: "SAR",
CLZ: "CLZ",
ADDMOD: "ADDMOD",
MULMOD: "MULMOD",
@ -484,6 +486,7 @@ var stringToOp = map[string]OpCode{
"SHL": SHL,
"SHR": SHR,
"SAR": SAR,
"CLZ": CLZ,
"ADDMOD": ADDMOD,
"MULMOD": MULMOD,
"KECCAK256": KECCAK256,

View file

@ -36,7 +36,7 @@ func makeGasSStoreFunc(clearingRefund uint64) gasFunc {
var (
y, x = stack.Back(1), stack.peek()
slot = common.Hash(x.Bytes32())
current = evm.StateDB.GetState(contract.Address(), slot)
current, original = evm.StateDB.GetStateAndCommittedState(contract.Address(), slot)
cost = uint64(0)
)
// Check slot presence in the access list
@ -52,7 +52,6 @@ func makeGasSStoreFunc(clearingRefund uint64) gasFunc {
// return params.SloadGasEIP2200, nil
return cost + params.WarmStorageReadCostEIP2929, nil // SLOAD_GAS
}
original := evm.StateDB.GetCommittedState(contract.Address(), x.Bytes32())
if original == current {
if original == (common.Hash{}) { // create slot (2.1.1)
return cost + params.SstoreSetGasEIP2200, nil

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,33 @@
// Copyright 2024 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 secp256r1 implements signature verification for the P256VERIFY precompile.
package secp256r1
import (
"crypto/ecdsa"
"crypto/elliptic"
"math/big"
)
// Verify checks the given signature (r, s) for the given hash and public key (x, y).
func Verify(hash []byte, r, s, x, y *big.Int) bool {
if x == nil || y == nil || !elliptic.P256().IsOnCurve(x, y) {
return false
}
pk := &ecdsa.PublicKey{Curve: elliptic.P256(), X: x, Y: y}
return ecdsa.Verify(pk, hash, r, s)
}

View file

@ -278,7 +278,11 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if fb := eth.blockchain.CurrentFinalBlock(); fb != nil {
finalBlock = fb.Number.Uint64()
}
eth.filterMaps = filtermaps.NewFilterMaps(chainDb, chainView, historyCutoff, finalBlock, filtermaps.DefaultParams, fmConfig)
filterMaps, err := filtermaps.NewFilterMaps(chainDb, chainView, historyCutoff, finalBlock, filtermaps.DefaultParams, fmConfig)
if err != nil {
return nil, err
}
eth.filterMaps = filterMaps
eth.closeFilterMaps = make(chan chan struct{})
// TxPool

View file

@ -208,6 +208,12 @@ func (c *SimulatedBeacon) sealBlock(withdrawals []*types.Withdrawal, timestamp u
return errors.New("chain rewind prevented invocation of payload creation")
}
// If the payload was already known, we can skip the rest of the process.
// This edge case is possible due to a race condition between seal and debug.setHead.
if fcResponse.PayloadStatus.Status == engine.VALID && fcResponse.PayloadID == nil {
return nil
}
envelope, err := c.engineAPI.getPayload(*fcResponse.PayloadID, true)
if err != nil {
return err

View file

@ -70,9 +70,14 @@ func (a *simulatedBeaconAPI) loop() {
if executable, _ := a.sim.eth.TxPool().Stats(); executable == 0 {
break
}
select {
case <-a.sim.shutdownCh:
return
default:
a.sim.Commit()
}
}
}
}()
for {

View file

@ -39,16 +39,18 @@ type FullSyncTester struct {
target common.Hash
closed chan struct{}
wg sync.WaitGroup
exitWhenSynced bool
}
// RegisterFullSyncTester registers the full-sync tester service into the node
// stack for launching and stopping the service controlled by node.
func RegisterFullSyncTester(stack *node.Node, backend *eth.Ethereum, target common.Hash) (*FullSyncTester, error) {
func RegisterFullSyncTester(stack *node.Node, backend *eth.Ethereum, target common.Hash, exitWhenSynced bool) (*FullSyncTester, error) {
cl := &FullSyncTester{
stack: stack,
backend: backend,
target: target,
closed: make(chan struct{}),
exitWhenSynced: exitWhenSynced,
}
stack.RegisterLifecycle(cl)
return cl, nil
@ -76,7 +78,11 @@ func (tester *FullSyncTester) Start() error {
// Stop in case the target block is already stored locally.
if block := tester.backend.BlockChain().GetBlockByHash(tester.target); block != nil {
log.Info("Full-sync target reached", "number", block.NumberU64(), "hash", block.Hash())
if tester.exitWhenSynced {
go tester.stack.Close() // async since we need to close ourselves
log.Info("Terminating the node")
}
return
}

View file

@ -384,7 +384,7 @@ func (s *skeleton) sync(head *types.Header) (*types.Header, error) {
defer close(done)
filled := s.filler.suspend()
if filled == nil {
log.Error("Latest filled block is not available")
log.Warn("Latest filled block is not available")
return
}
// If something was filled, try to delete stale sync helpers. If

View file

@ -175,7 +175,7 @@ func (b *testBackend) startFilterMaps(history uint64, disabled bool, params filt
Disabled: disabled,
ExportFileName: "",
}
b.fm = filtermaps.NewFilterMaps(b.db, chainView, 0, 0, params, config)
b.fm, _ = filtermaps.NewFilterMaps(b.db, chainView, 0, 0, params, config)
b.fm.Start()
b.fm.WaitIdle()
}

View file

@ -317,26 +317,26 @@ func testFilters(t *testing.T, history uint64, noHistory bool) {
}{
{
f: sys.NewBlockFilter(chain[2].Hash(), []common.Address{contract}, nil),
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":30,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":"0x1e","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(0, int64(rpc.LatestBlockNumber), []common.Address{contract}, [][]common.Hash{{hash1, hash2, hash3, hash4}}),
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x2","transactionHash":"0xa8028c655b6423204c8edfbc339f57b042d6bec2b6a61145d76b7c08b4cccd42","transactionIndex":"0x0","blockHash":"0x24417bb49ce44cfad65da68f33b510bf2a129c0d89ccf06acb6958b8585ccf34","blockTimestamp":20,"logIndex":"0x0","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":30,"logIndex":"0x0","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696334"],"data":"0x","blockNumber":"0x3e8","transactionHash":"0x9a87842100a638dfa5da8842b4beda691d2fd77b0c84b57f24ecfa9fb208f747","transactionIndex":"0x0","blockHash":"0xb360bad5265261c075ece02d3bf0e39498a6a76310482cdfd90588748e6c5ee0","blockTimestamp":10000,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x2","transactionHash":"0xa8028c655b6423204c8edfbc339f57b042d6bec2b6a61145d76b7c08b4cccd42","transactionIndex":"0x0","blockHash":"0x24417bb49ce44cfad65da68f33b510bf2a129c0d89ccf06acb6958b8585ccf34","blockTimestamp":"0x14","logIndex":"0x0","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":"0x1e","logIndex":"0x0","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696334"],"data":"0x","blockNumber":"0x3e8","transactionHash":"0x9a87842100a638dfa5da8842b4beda691d2fd77b0c84b57f24ecfa9fb208f747","transactionIndex":"0x0","blockHash":"0xb360bad5265261c075ece02d3bf0e39498a6a76310482cdfd90588748e6c5ee0","blockTimestamp":"0x2710","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(900, 999, []common.Address{contract}, [][]common.Hash{{hash3}}),
},
{
f: sys.NewRangeFilter(990, int64(rpc.LatestBlockNumber), []common.Address{contract2}, [][]common.Hash{{hash3}}),
want: `[{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696333"],"data":"0x","blockNumber":"0x3e7","transactionHash":"0x53e3675800c6908424b61b35a44e51ca4c73ca603e58a65b32c67968b4f42200","transactionIndex":"0x0","blockHash":"0x2e4620a2b426b0612ec6cad9603f466723edaed87f98c9137405dd4f7a2409ff","blockTimestamp":9990,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696333"],"data":"0x","blockNumber":"0x3e7","transactionHash":"0x53e3675800c6908424b61b35a44e51ca4c73ca603e58a65b32c67968b4f42200","transactionIndex":"0x0","blockHash":"0x2e4620a2b426b0612ec6cad9603f466723edaed87f98c9137405dd4f7a2409ff","blockTimestamp":"0x2706","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(1, 10, []common.Address{contract}, [][]common.Hash{{hash2}, {hash1}}),
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":30,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":"0x1e","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(1, 10, nil, [][]common.Hash{{hash1, hash2}}),
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x2","transactionHash":"0xa8028c655b6423204c8edfbc339f57b042d6bec2b6a61145d76b7c08b4cccd42","transactionIndex":"0x0","blockHash":"0x24417bb49ce44cfad65da68f33b510bf2a129c0d89ccf06acb6958b8585ccf34","blockTimestamp":20,"logIndex":"0x0","removed":false},{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x2","transactionHash":"0xdba3e2ea9a7d690b722d70ee605fd67ba4c00d1d3aecd5cf187a7b92ad8eb3df","transactionIndex":"0x1","blockHash":"0x24417bb49ce44cfad65da68f33b510bf2a129c0d89ccf06acb6958b8585ccf34","blockTimestamp":20,"logIndex":"0x1","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":30,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x2","transactionHash":"0xa8028c655b6423204c8edfbc339f57b042d6bec2b6a61145d76b7c08b4cccd42","transactionIndex":"0x0","blockHash":"0x24417bb49ce44cfad65da68f33b510bf2a129c0d89ccf06acb6958b8585ccf34","blockTimestamp":"0x14","logIndex":"0x0","removed":false},{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x2","transactionHash":"0xdba3e2ea9a7d690b722d70ee605fd67ba4c00d1d3aecd5cf187a7b92ad8eb3df","transactionIndex":"0x1","blockHash":"0x24417bb49ce44cfad65da68f33b510bf2a129c0d89ccf06acb6958b8585ccf34","blockTimestamp":"0x14","logIndex":"0x1","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696332","0x0000000000000000000000000000000000000000000000000000746f70696331"],"data":"0x","blockNumber":"0x3","transactionHash":"0xdefe471992a07a02acdfbe33edaae22fbb86d7d3cec3f1b8e4e77702fb3acc1d","transactionIndex":"0x0","blockHash":"0x7a7556792ca7d37882882e2b001fe14833eaf81c2c7f865c9c771ec37a024f6b","blockTimestamp":"0x1e","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(0, int64(rpc.LatestBlockNumber), nil, [][]common.Hash{{common.BytesToHash([]byte("fail"))}}),
@ -349,15 +349,15 @@ func testFilters(t *testing.T, history uint64, noHistory bool) {
},
{
f: sys.NewRangeFilter(int64(rpc.LatestBlockNumber), int64(rpc.LatestBlockNumber), nil, nil),
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696334"],"data":"0x","blockNumber":"0x3e8","transactionHash":"0x9a87842100a638dfa5da8842b4beda691d2fd77b0c84b57f24ecfa9fb208f747","transactionIndex":"0x0","blockHash":"0xb360bad5265261c075ece02d3bf0e39498a6a76310482cdfd90588748e6c5ee0","blockTimestamp":10000,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696334"],"data":"0x","blockNumber":"0x3e8","transactionHash":"0x9a87842100a638dfa5da8842b4beda691d2fd77b0c84b57f24ecfa9fb208f747","transactionIndex":"0x0","blockHash":"0xb360bad5265261c075ece02d3bf0e39498a6a76310482cdfd90588748e6c5ee0","blockTimestamp":"0x2710","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(int64(rpc.FinalizedBlockNumber), int64(rpc.LatestBlockNumber), nil, nil),
want: `[{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696333"],"data":"0x","blockNumber":"0x3e7","transactionHash":"0x53e3675800c6908424b61b35a44e51ca4c73ca603e58a65b32c67968b4f42200","transactionIndex":"0x0","blockHash":"0x2e4620a2b426b0612ec6cad9603f466723edaed87f98c9137405dd4f7a2409ff","blockTimestamp":9990,"logIndex":"0x0","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696334"],"data":"0x","blockNumber":"0x3e8","transactionHash":"0x9a87842100a638dfa5da8842b4beda691d2fd77b0c84b57f24ecfa9fb208f747","transactionIndex":"0x0","blockHash":"0xb360bad5265261c075ece02d3bf0e39498a6a76310482cdfd90588748e6c5ee0","blockTimestamp":10000,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696333"],"data":"0x","blockNumber":"0x3e7","transactionHash":"0x53e3675800c6908424b61b35a44e51ca4c73ca603e58a65b32c67968b4f42200","transactionIndex":"0x0","blockHash":"0x2e4620a2b426b0612ec6cad9603f466723edaed87f98c9137405dd4f7a2409ff","blockTimestamp":"0x2706","logIndex":"0x0","removed":false},{"address":"0xfe00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696334"],"data":"0x","blockNumber":"0x3e8","transactionHash":"0x9a87842100a638dfa5da8842b4beda691d2fd77b0c84b57f24ecfa9fb208f747","transactionIndex":"0x0","blockHash":"0xb360bad5265261c075ece02d3bf0e39498a6a76310482cdfd90588748e6c5ee0","blockTimestamp":"0x2710","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(int64(rpc.FinalizedBlockNumber), int64(rpc.FinalizedBlockNumber), nil, nil),
want: `[{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696333"],"data":"0x","blockNumber":"0x3e7","transactionHash":"0x53e3675800c6908424b61b35a44e51ca4c73ca603e58a65b32c67968b4f42200","transactionIndex":"0x0","blockHash":"0x2e4620a2b426b0612ec6cad9603f466723edaed87f98c9137405dd4f7a2409ff","blockTimestamp":9990,"logIndex":"0x0","removed":false}]`,
want: `[{"address":"0xff00000000000000000000000000000000000000","topics":["0x0000000000000000000000000000000000000000000000000000746f70696333"],"data":"0x","blockNumber":"0x3e7","transactionHash":"0x53e3675800c6908424b61b35a44e51ca4c73ca603e58a65b32c67968b4f42200","transactionIndex":"0x0","blockHash":"0x2e4620a2b426b0612ec6cad9603f466723edaed87f98c9137405dd4f7a2409ff","blockTimestamp":"0x2706","logIndex":"0x0","removed":false}]`,
},
{
f: sys.NewRangeFilter(int64(rpc.LatestBlockNumber), int64(rpc.FinalizedBlockNumber), nil, nil),

View file

@ -39,6 +39,10 @@ func (*dummyStatedb) SetState(_ common.Address, _ common.Hash, _ common.Hash) co
return common.Hash{}
}
func (*dummyStatedb) GetStateAndCommittedState(common.Address, common.Hash) (common.Hash, common.Hash) {
return common.Hash{}, common.Hash{}
}
func TestStoreCapture(t *testing.T) {
var (
logger = NewStructLogger(nil)

View file

@ -216,6 +216,17 @@ func (ec *Client) TraceTransaction(ctx context.Context, hash common.Hash, config
return result, nil
}
// TraceBlock returns the structured logs created during the execution of EVM
// and returns them as a JSON object.
func (ec *Client) TraceBlock(ctx context.Context, hash common.Hash, config *tracers.TraceConfig) (any, error) {
var result any
err := ec.c.CallContext(ctx, &result, "debug_traceBlockByHash", hash, config)
if err != nil {
return nil, err
}
return result, nil
}
func toBlockNumArg(number *big.Int) string {
if number == nil {
return "latest"

View file

@ -55,13 +55,13 @@ var (
Usage: "Per-module verbosity: comma-separated list of <pattern>=<level> (e.g. eth/*=5,p2p=4)",
Value: "",
Hidden: true,
Category: flags.LoggingCategory,
Category: flags.DeprecatedCategory,
}
logjsonFlag = &cli.BoolFlag{
Name: "log.json",
Usage: "Format logs with JSON",
Hidden: true,
Category: flags.LoggingCategory,
Category: flags.DeprecatedCategory,
}
logFormatFlag = &cli.StringFlag{
Name: "log.format",

View file

@ -20,7 +20,7 @@
"transactionHash": "0xeaf3921cbf03ba45bad4e6ab807b196ce3b2a0b5bacc355b6272fa96b11b4287",
"transactionIndex": "0x0",
"blockHash": "0xcc6225bf39327429a3d869af71182d619a354155187d0b5a8ecd6a9309cffcaa",
"blockTimestamp": 30,
"blockTimestamp": "0x1e",
"logIndex": "0x0",
"removed": false
}

View file

@ -19,7 +19,7 @@
"transactionHash": "0xeaf3921cbf03ba45bad4e6ab807b196ce3b2a0b5bacc355b6272fa96b11b4287",
"transactionIndex": "0x0",
"blockHash": "0xcc6225bf39327429a3d869af71182d619a354155187d0b5a8ecd6a9309cffcaa",
"blockTimestamp": 30,
"blockTimestamp": "0x1e",
"logIndex": "0x0",
"removed": false
}

View file

@ -17,19 +17,18 @@
package flags
import (
"os/user"
"runtime"
"testing"
)
func TestPathExpansion(t *testing.T) {
user, _ := user.Current()
home := HomeDir()
var tests map[string]string
if runtime.GOOS == "windows" {
tests = map[string]string{
`/home/someuser/tmp`: `\home\someuser\tmp`,
`~/tmp`: user.HomeDir + `\tmp`,
`~/tmp`: home + `\tmp`,
`~thisOtherUser/b/`: `~thisOtherUser\b`,
`$DDDXXX/a/b`: `\tmp\a\b`,
`/a/b/`: `\a\b`,
@ -40,7 +39,7 @@ func TestPathExpansion(t *testing.T) {
} else {
tests = map[string]string{
`/home/someuser/tmp`: `/home/someuser/tmp`,
`~/tmp`: user.HomeDir + `/tmp`,
`~/tmp`: home + `/tmp`,
`~thisOtherUser/b/`: `~thisOtherUser/b`,
`$DDDXXX/a/b`: `/tmp/a/b`,
`/a/b/`: `/a/b`,

View file

@ -2510,10 +2510,8 @@ var RequestManager = require('./web3/requestmanager');
var Iban = require('./web3/iban');
var Eth = require('./web3/methods/eth');
var DB = require('./web3/methods/db');
var Shh = require('./web3/methods/shh');
var Net = require('./web3/methods/net');
var Personal = require('./web3/methods/personal');
var Swarm = require('./web3/methods/swarm');
var Settings = require('./web3/settings');
var version = require('./version.json');
var utils = require('./utils/utils');
@ -2532,10 +2530,8 @@ function Web3 (provider) {
this.currentProvider = provider;
this.eth = new Eth(this);
this.db = new DB(this);
this.shh = new Shh(this);
this.net = new Net(this);
this.personal = new Personal(this);
this.bzz = new Swarm(this);
this.settings = new Settings();
this.version = {
api: version.version
@ -2612,11 +2608,6 @@ var properties = function () {
name: 'version.ethereum',
getter: 'eth_protocolVersion',
inputFormatter: utils.toDecimal
}),
new Property({
name: 'version.whisper',
getter: 'shh_version',
inputFormatter: utils.toDecimal
})
];
};
@ -2632,7 +2623,7 @@ Web3.prototype.createBatch = function () {
module.exports = Web3;
},{"./utils/sha3":19,"./utils/utils":20,"./version.json":21,"./web3/batch":24,"./web3/extend":28,"./web3/httpprovider":32,"./web3/iban":33,"./web3/ipcprovider":34,"./web3/methods/db":37,"./web3/methods/eth":38,"./web3/methods/net":39,"./web3/methods/personal":40,"./web3/methods/shh":41,"./web3/methods/swarm":42,"./web3/property":45,"./web3/requestmanager":46,"./web3/settings":47,"bignumber.js":"bignumber.js"}],23:[function(require,module,exports){
},{"./utils/sha3":19,"./utils/utils":20,"./version.json":21,"./web3/batch":24,"./web3/extend":28,"./web3/httpprovider":32,"./web3/iban":33,"./web3/ipcprovider":34,"./web3/methods/db":37,"./web3/methods/eth":38,"./web3/methods/net":39,"./web3/methods/personal":40,"./web3/property":45,"./web3/requestmanager":46,"./web3/settings":47,"bignumber.js":"bignumber.js"}],23:[function(require,module,exports){
/*
This file is part of web3.js.
@ -3486,8 +3477,6 @@ var getOptions = function (options, type) {
fromBlock: formatters.inputBlockNumberFormatter(options.fromBlock),
toBlock: formatters.inputBlockNumberFormatter(options.toBlock)
};
case 'shh':
return options;
}
};
@ -5699,300 +5688,7 @@ var properties = function () {
module.exports = Personal;
},{"../formatters":30,"../method":36,"../property":45}],41:[function(require,module,exports){
/*
This file is part of web3.js.
web3.js 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.
web3.js 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 web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file shh.js
* @authors:
* Fabian Vogelsteller <fabian@ethereum.org>
* Marek Kotewicz <marek@ethcore.io>
* @date 2017
*/
var Method = require('../method');
var Filter = require('../filter');
var watches = require('./watches');
var Shh = function (web3) {
this._requestManager = web3._requestManager;
var self = this;
methods().forEach(function(method) {
method.attachToObject(self);
method.setRequestManager(self._requestManager);
});
};
Shh.prototype.newMessageFilter = function (options, callback, filterCreationErrorCallback) {
return new Filter(options, 'shh', this._requestManager, watches.shh(), null, callback, filterCreationErrorCallback);
};
var methods = function () {
return [
new Method({
name: 'version',
call: 'shh_version',
params: 0
}),
new Method({
name: 'info',
call: 'shh_info',
params: 0
}),
new Method({
name: 'setMaxMessageSize',
call: 'shh_setMaxMessageSize',
params: 1
}),
new Method({
name: 'setMinPoW',
call: 'shh_setMinPoW',
params: 1
}),
new Method({
name: 'markTrustedPeer',
call: 'shh_markTrustedPeer',
params: 1
}),
new Method({
name: 'newKeyPair',
call: 'shh_newKeyPair',
params: 0
}),
new Method({
name: 'addPrivateKey',
call: 'shh_addPrivateKey',
params: 1
}),
new Method({
name: 'deleteKeyPair',
call: 'shh_deleteKeyPair',
params: 1
}),
new Method({
name: 'hasKeyPair',
call: 'shh_hasKeyPair',
params: 1
}),
new Method({
name: 'getPublicKey',
call: 'shh_getPublicKey',
params: 1
}),
new Method({
name: 'getPrivateKey',
call: 'shh_getPrivateKey',
params: 1
}),
new Method({
name: 'newSymKey',
call: 'shh_newSymKey',
params: 0
}),
new Method({
name: 'addSymKey',
call: 'shh_addSymKey',
params: 1
}),
new Method({
name: 'generateSymKeyFromPassword',
call: 'shh_generateSymKeyFromPassword',
params: 1
}),
new Method({
name: 'hasSymKey',
call: 'shh_hasSymKey',
params: 1
}),
new Method({
name: 'getSymKey',
call: 'shh_getSymKey',
params: 1
}),
new Method({
name: 'deleteSymKey',
call: 'shh_deleteSymKey',
params: 1
}),
// subscribe and unsubscribe missing
new Method({
name: 'post',
call: 'shh_post',
params: 1,
inputFormatter: [null]
})
];
};
module.exports = Shh;
},{"../filter":29,"../method":36,"./watches":43}],42:[function(require,module,exports){
/*
This file is part of web3.js.
web3.js 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.
web3.js 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 web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file bzz.js
* @author Alex Beregszaszi <alex@rtfs.hu>
* @date 2016
*
* Reference: https://github.com/ethereum/go-ethereum/blob/swarm/internal/web3ext/web3ext.go#L33
*/
"use strict";
var Method = require('../method');
var Property = require('../property');
function Swarm(web3) {
this._requestManager = web3._requestManager;
var self = this;
methods().forEach(function(method) {
method.attachToObject(self);
method.setRequestManager(self._requestManager);
});
properties().forEach(function(p) {
p.attachToObject(self);
p.setRequestManager(self._requestManager);
});
}
var methods = function () {
var blockNetworkRead = new Method({
name: 'blockNetworkRead',
call: 'bzz_blockNetworkRead',
params: 1,
inputFormatter: [null]
});
var syncEnabled = new Method({
name: 'syncEnabled',
call: 'bzz_syncEnabled',
params: 1,
inputFormatter: [null]
});
var swapEnabled = new Method({
name: 'swapEnabled',
call: 'bzz_swapEnabled',
params: 1,
inputFormatter: [null]
});
var download = new Method({
name: 'download',
call: 'bzz_download',
params: 2,
inputFormatter: [null, null]
});
var upload = new Method({
name: 'upload',
call: 'bzz_upload',
params: 2,
inputFormatter: [null, null]
});
var retrieve = new Method({
name: 'retrieve',
call: 'bzz_retrieve',
params: 1,
inputFormatter: [null]
});
var store = new Method({
name: 'store',
call: 'bzz_store',
params: 2,
inputFormatter: [null, null]
});
var get = new Method({
name: 'get',
call: 'bzz_get',
params: 1,
inputFormatter: [null]
});
var put = new Method({
name: 'put',
call: 'bzz_put',
params: 2,
inputFormatter: [null, null]
});
var modify = new Method({
name: 'modify',
call: 'bzz_modify',
params: 4,
inputFormatter: [null, null, null, null]
});
return [
blockNetworkRead,
syncEnabled,
swapEnabled,
download,
upload,
retrieve,
store,
get,
put,
modify
];
};
var properties = function () {
return [
new Property({
name: 'hive',
getter: 'bzz_hive'
}),
new Property({
name: 'info',
getter: 'bzz_info'
})
];
};
module.exports = Swarm;
},{"../method":36,"../property":45}],43:[function(require,module,exports){
},{"../formatters":30,"../method":36,"../property":45}],43:[function(require,module,exports){
/*
This file is part of web3.js.
@ -6068,36 +5764,8 @@ var eth = function () {
];
};
/// @returns an array of objects describing web3.shh.watch api methods
var shh = function () {
return [
new Method({
name: 'newFilter',
call: 'shh_newMessageFilter',
params: 1
}),
new Method({
name: 'uninstallFilter',
call: 'shh_deleteMessageFilter',
params: 1
}),
new Method({
name: 'getLogs',
call: 'shh_getFilterMessages',
params: 1
}),
new Method({
name: 'poll',
call: 'shh_getFilterMessages',
params: 1
})
];
};
module.exports = {
eth: eth,
shh: shh
eth: eth
};

View file

@ -50,6 +50,7 @@ type environment struct {
signer types.Signer
state *state.StateDB // apply state changes here
tcount int // tx count in cycle
size uint64 // size of the block we are building
gasPool *core.GasPool // available gas used to pack transactions
coinbase common.Address
evm *vm.EVM
@ -63,6 +64,11 @@ type environment struct {
witness *stateless.Witness
}
// txFits reports whether the transaction fits into the block size limit.
func (env *environment) txFitsSize(tx *types.Transaction) bool {
return env.size+tx.Size() < params.MaxBlockSize-maxBlockSizeBufferZone
}
const (
commitInterruptNone int32 = iota
commitInterruptNewHead
@ -70,6 +76,11 @@ const (
commitInterruptTimeout
)
// Block size is capped by the protocol at params.MaxBlockSize. When producing blocks, we
// try to say below the size including a buffer zone, this is to avoid going over the
// maximum size with auxiliary data added into the block.
const maxBlockSizeBufferZone = 1_000_000
// newPayloadResult is the result of payload generation.
type newPayloadResult struct {
err error
@ -95,12 +106,23 @@ type generateParams struct {
}
// generateWork generates a sealing block based on the given parameters.
func (miner *Miner) generateWork(params *generateParams, witness bool) *newPayloadResult {
work, err := miner.prepareWork(params, witness)
func (miner *Miner) generateWork(genParam *generateParams, witness bool) *newPayloadResult {
work, err := miner.prepareWork(genParam, witness)
if err != nil {
return &newPayloadResult{err: err}
}
if !params.noTxs {
// Check withdrawals fit max block size.
// Due to the cap on withdrawal count, this can actually never happen, but we still need to
// check to ensure the CL notices there's a problem if the withdrawal cap is ever lifted.
maxBlockSize := params.MaxBlockSize - maxBlockSizeBufferZone
if genParam.withdrawals.Size() > maxBlockSize {
return &newPayloadResult{err: errors.New("withdrawals exceed max block size")}
}
// Also add size of withdrawals to work block size.
work.size += uint64(genParam.withdrawals.Size())
if !genParam.noTxs {
interrupt := new(atomic.Int32)
timer := time.AfterFunc(miner.config.Recommit, func() {
interrupt.Store(commitInterruptTimeout)
@ -112,8 +134,8 @@ func (miner *Miner) generateWork(params *generateParams, witness bool) *newPaylo
log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(miner.config.Recommit))
}
}
body := types.Body{Transactions: work.txs, Withdrawals: genParam.withdrawals}
body := types.Body{Transactions: work.txs, Withdrawals: params.withdrawals}
allLogs := make([]*types.Log, 0)
for _, r := range work.receipts {
allLogs = append(allLogs, r.Logs...)
@ -256,6 +278,7 @@ func (miner *Miner) makeEnv(parent *types.Header, header *types.Header, coinbase
return &environment{
signer: types.MakeSigner(miner.chainConfig, header.Number, header.Time),
state: state,
size: uint64(header.Size()),
coinbase: coinbase,
header: header,
witness: state.Witness(),
@ -273,6 +296,7 @@ func (miner *Miner) commitTransaction(env *environment, tx *types.Transaction) e
}
env.txs = append(env.txs, tx)
env.receipts = append(env.receipts, receipt)
env.size += tx.Size()
env.tcount++
return nil
}
@ -294,10 +318,12 @@ func (miner *Miner) commitBlobTransaction(env *environment, tx *types.Transactio
if err != nil {
return err
}
env.txs = append(env.txs, tx.WithoutBlobTxSidecar())
txNoBlob := tx.WithoutBlobTxSidecar()
env.txs = append(env.txs, txNoBlob)
env.receipts = append(env.receipts, receipt)
env.sidecars = append(env.sidecars, sc)
env.blobs += len(sc.Blobs)
env.size += txNoBlob.Size()
*env.header.BlobGasUsed += receipt.BlobGasUsed
env.tcount++
return nil
@ -318,7 +344,11 @@ func (miner *Miner) applyTransaction(env *environment, tx *types.Transaction) (*
}
func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32) error {
gasLimit := env.header.GasLimit
var (
isOsaka = miner.chainConfig.IsOsaka(env.header.Number, env.header.Time)
isCancun = miner.chainConfig.IsCancun(env.header.Number, env.header.Time)
gasLimit = env.header.GasLimit
)
if env.gasPool == nil {
env.gasPool = new(core.GasPool).AddGas(gasLimit)
}
@ -374,7 +404,7 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
// Most of the blob gas logic here is agnostic as to if the chain supports
// blobs or not, however the max check panics when called on a chain without
// a defined schedule, so we need to verify it's safe to call.
if miner.chainConfig.IsCancun(env.header.Number, env.header.Time) {
if isCancun {
left := eip4844.MaxBlobsPerBlock(miner.chainConfig, env.header.Time) - env.blobs
if left < int(ltx.BlobGas/params.BlobTxBlobGasPerBlob) {
log.Trace("Not enough blob space left for transaction", "hash", ltx.Hash, "left", left, "needed", ltx.BlobGas/params.BlobTxBlobGasPerBlob)
@ -391,8 +421,14 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
continue
}
// if inclusion of the transaction would put the block size over the
// maximum we allow, don't add any more txs to the payload.
if !env.txFitsSize(tx) {
break
}
// Make sure all transactions after osaka have cell proofs
if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) {
if isOsaka {
if sidecar := tx.BlobTxSidecar(); sidecar != nil {
if sidecar.Version == 0 {
log.Info("Including blob tx with v0 sidecar, recomputing proofs", "hash", ltx.Hash)
@ -462,6 +498,9 @@ func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment)
if env.header.ExcessBlobGas != nil {
filter.BlobFee = uint256.MustFromBig(eip4844.CalcBlobFee(miner.chainConfig, env.header))
}
if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) {
filter.GasLimitCap = params.MaxTxGas
}
filter.OnlyPlainTxs, filter.OnlyBlobTxs = true, false
pendingPlainTxs := miner.txpool.Pending(filter)

View file

@ -171,7 +171,7 @@ func (h *httpServer) start() error {
}
// Log http endpoint.
h.log.Info("HTTP server started",
"endpoint", listener.Addr(), "auth", (h.httpConfig.jwtSecret != nil),
"endpoint", listener.Addr(), "auth", h.httpConfig.jwtSecret != nil,
"prefix", h.httpConfig.prefix,
"cors", strings.Join(h.httpConfig.CorsAllowedOrigins, ","),
"vhosts", strings.Join(h.httpConfig.Vhosts, ","),

View file

@ -28,6 +28,8 @@ const (
MaxGasLimit uint64 = 0x7fffffffffffffff // Maximum the gas limit (2^63-1).
GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block.
MaxTxGas uint64 = 30_000_000 // Maximum transaction gas limit after eip-7825.
MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis.
ExpByteGas uint64 = 10 // Times ceil(log256(exponent)) for the EXP instruction.
SloadGas uint64 = 50 // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added.
@ -163,6 +165,8 @@ const (
Bls12381MapG1Gas uint64 = 5500 // Gas price for BLS12-381 mapping field element to G1 operation
Bls12381MapG2Gas uint64 = 23800 // Gas price for BLS12-381 mapping field element to G2 operation
P256VerifyGas uint64 = 6900 // secp256r1 elliptic curve signature verifier gas price
// The Refund Quotient is the cap on how much of the used gas can be refunded. Before EIP-3529,
// up to half the consumed gas could be refunded. Redefined as 1/5th in EIP-3529
RefundQuotient uint64 = 2
@ -173,6 +177,9 @@ const (
BlobTxBlobGasPerBlob = 1 << 17 // Gas consumption of a single data blob (== blob byte size)
BlobTxMinBlobGasprice = 1 // Minimum gas price for data blobs
BlobTxPointEvaluationPrecompileGas = 50000 // Gas price for the point evaluation precompile.
BlobBaseCost = 1 << 13 // Base execution gas cost for a blob.
MaxBlockSize = 8_388_608 // maximum size of an RLP-encoded block
)
// Bls12381G1MultiExpDiscountTable is the gas discount table for BLS12-381 G1 multi exponentiation operation

View file

@ -487,12 +487,6 @@ func (c *Client) EthSubscribe(ctx context.Context, channel interface{}, args ...
return c.Subscribe(ctx, "eth", channel, args...)
}
// ShhSubscribe registers a subscription under the "shh" namespace.
// Deprecated: use Subscribe(ctx, "shh", ...).
func (c *Client) ShhSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*ClientSubscription, error) {
return c.Subscribe(ctx, "shh", channel, args...)
}
// Subscribe calls the "<namespace>_subscribe" method with the given arguments,
// registering a subscription. Server notifications for the subscription are
// sent to the given channel. The element type of the channel must match the

View file

@ -59,7 +59,7 @@ func TestSubscriptions(t *testing.T) {
t.Parallel()
var (
namespaces = []string{"eth", "bzz"}
namespaces = []string{"eth"}
service = &notificationTestService{}
subCount = len(namespaces)
notificationCount = 3

View file

@ -73,8 +73,8 @@ func storeIndexMetadata(db ethdb.KeyValueWriter, last uint64) {
// batchIndexer is a structure designed to perform batch indexing or unindexing
// of state histories atomically.
type batchIndexer struct {
accounts map[common.Hash][]uint64 // History ID list, Keyed by account address
storages map[common.Hash]map[common.Hash][]uint64 // History ID list, Keyed by account address and the hash of raw storage key
accounts map[common.Hash][]uint64 // History ID list, Keyed by the hash of account address
storages map[common.Hash]map[common.Hash][]uint64 // History ID list, Keyed by the hash of account address and the hash of raw storage key
counter int // The counter of processed states
delete bool // Index or unindex mode
lastID uint64 // The ID of latest processed history

Some files were not shown because too many files have changed in this diff Show more