From 04975b21b4774b64b4d031fce899a4f6b293b24d Mon Sep 17 00:00:00 2001 From: maskpp Date: Thu, 26 Sep 2024 22:29:37 +0800 Subject: [PATCH] feat(repo): Fix bug merge 1.14.9 (#320) * fix lint * fix bug * update generation files --- .../usbwallet/trezor/messages-common.pb.go | 28 +++++------ .../usbwallet/trezor/messages-ethereum.pb.go | 22 ++++---- .../trezor/messages-management.pb.go | 50 +++++++++---------- accounts/usbwallet/trezor/messages.pb.go | 4 +- beacon/engine/gen_ed.go | 15 +++--- beacon/engine/types.go | 2 +- miner/taiko_miner.go | 2 +- 7 files changed, 61 insertions(+), 62 deletions(-) diff --git a/accounts/usbwallet/trezor/messages-common.pb.go b/accounts/usbwallet/trezor/messages-common.pb.go index 9a46a29e7bdd..eab6a66217fa 100644 --- a/accounts/usbwallet/trezor/messages-common.pb.go +++ b/accounts/usbwallet/trezor/messages-common.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v5.28.1 +// protoc v5.28.0 // source: messages-common.proto package trezor @@ -113,7 +113,7 @@ func (Failure_FailureType) EnumDescriptor() ([]byte, []int) { return file_messages_common_proto_rawDescGZIP(), []int{1, 0} } -//* +// * // Type of button request type ButtonRequest_ButtonRequestType int32 @@ -210,7 +210,7 @@ func (ButtonRequest_ButtonRequestType) EnumDescriptor() ([]byte, []int) { return file_messages_common_proto_rawDescGZIP(), []int{2, 0} } -//* +// * // Type of PIN request type PinMatrixRequest_PinMatrixRequestType int32 @@ -271,7 +271,7 @@ func (PinMatrixRequest_PinMatrixRequestType) EnumDescriptor() ([]byte, []int) { return file_messages_common_proto_rawDescGZIP(), []int{4, 0} } -//* +// * // Response: Success of the previous request // @end type Success struct { @@ -321,7 +321,7 @@ func (x *Success) GetMessage() string { return "" } -//* +// * // Response: Failure of the previous request // @end type Failure struct { @@ -379,7 +379,7 @@ func (x *Failure) GetMessage() string { return "" } -//* +// * // Response: Device is waiting for HW button press. // @auxstart // @next ButtonAck @@ -438,7 +438,7 @@ func (x *ButtonRequest) GetData() string { return "" } -//* +// * // Request: Computer agrees to wait for HW button press // @auxend type ButtonAck struct { @@ -479,7 +479,7 @@ func (*ButtonAck) Descriptor() ([]byte, []int) { return file_messages_common_proto_rawDescGZIP(), []int{3} } -//* +// * // Response: Device is asking computer to show PIN matrix and awaits PIN encoded using this matrix scheme // @auxstart // @next PinMatrixAck @@ -530,7 +530,7 @@ func (x *PinMatrixRequest) GetType() PinMatrixRequest_PinMatrixRequestType { return PinMatrixRequest_PinMatrixRequestType_Current } -//* +// * // Request: Computer responds with encoded PIN // @auxend type PinMatrixAck struct { @@ -580,7 +580,7 @@ func (x *PinMatrixAck) GetPin() string { return "" } -//* +// * // Response: Device awaits encryption passphrase // @auxstart // @next PassphraseAck @@ -631,7 +631,7 @@ func (x *PassphraseRequest) GetOnDevice() bool { return false } -//* +// * // Request: Send passphrase back // @next PassphraseStateRequest type PassphraseAck struct { @@ -689,7 +689,7 @@ func (x *PassphraseAck) GetState() []byte { return nil } -//* +// * // Response: Device awaits passphrase state // @next PassphraseStateAck type PassphraseStateRequest struct { @@ -739,7 +739,7 @@ func (x *PassphraseStateRequest) GetState() []byte { return nil } -//* +// * // Request: Send passphrase state back // @auxend type PassphraseStateAck struct { @@ -780,7 +780,7 @@ func (*PassphraseStateAck) Descriptor() ([]byte, []int) { return file_messages_common_proto_rawDescGZIP(), []int{9} } -//* +// * // Structure representing BIP32 (hierarchical deterministic) node // Used for imports of private key into the device and exporting public key out of device // @embed diff --git a/accounts/usbwallet/trezor/messages-ethereum.pb.go b/accounts/usbwallet/trezor/messages-ethereum.pb.go index fcc62a9efe78..4c257655ca23 100644 --- a/accounts/usbwallet/trezor/messages-ethereum.pb.go +++ b/accounts/usbwallet/trezor/messages-ethereum.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v5.28.1 +// protoc v5.28.0 // source: messages-ethereum.proto package trezor @@ -24,7 +24,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//* +// * // Request: Ask device for public key corresponding to address_n path // @start // @next EthereumPublicKey @@ -84,7 +84,7 @@ func (x *EthereumGetPublicKey) GetShowDisplay() bool { return false } -//* +// * // Response: Contains public key derived from device private seed // @end type EthereumPublicKey struct { @@ -142,7 +142,7 @@ func (x *EthereumPublicKey) GetXpub() string { return "" } -//* +// * // Request: Ask device for Ethereum address corresponding to address_n path // @start // @next EthereumAddress @@ -202,7 +202,7 @@ func (x *EthereumGetAddress) GetShowDisplay() bool { return false } -//* +// * // Response: Contains an Ethereum address derived from device private seed // @end type EthereumAddress struct { @@ -260,7 +260,7 @@ func (x *EthereumAddress) GetAddressHex() string { return "" } -//* +// * // Request: Ask device to sign transaction // All fields are optional from the protocol's point of view. Each field defaults to value `0` if missing. // Note: the first at most 1024 bytes of data MUST be transmitted as part of this message. @@ -394,7 +394,7 @@ func (x *EthereumSignTx) GetTxType() uint32 { return 0 } -//* +// * // Response: Device asks for more data from transaction payload, or returns the signature. // If data_length is set, device awaits that many more bytes of payload. // Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present. @@ -471,7 +471,7 @@ func (x *EthereumTxRequest) GetSignatureS() []byte { return nil } -//* +// * // Request: Transaction payload data. // @next EthereumTxRequest type EthereumTxAck struct { @@ -521,7 +521,7 @@ func (x *EthereumTxAck) GetDataChunk() []byte { return nil } -//* +// * // Request: Ask device to sign message // @start // @next EthereumMessageSignature @@ -581,7 +581,7 @@ func (x *EthereumSignMessage) GetMessage() []byte { return nil } -//* +// * // Response: Signed message // @end type EthereumMessageSignature struct { @@ -647,7 +647,7 @@ func (x *EthereumMessageSignature) GetAddressHex() string { return "" } -//* +// * // Request: Ask device to verify message // @start // @next Success diff --git a/accounts/usbwallet/trezor/messages-management.pb.go b/accounts/usbwallet/trezor/messages-management.pb.go index 0ed22e7016e0..87bd68403987 100644 --- a/accounts/usbwallet/trezor/messages-management.pb.go +++ b/accounts/usbwallet/trezor/messages-management.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v5.28.1 +// protoc v5.28.0 // source: messages-management.proto package trezor @@ -24,7 +24,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//* +// * // Structure representing passphrase source type ApplySettings_PassphraseSourceType int32 @@ -85,7 +85,7 @@ func (ApplySettings_PassphraseSourceType) EnumDescriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{4, 0} } -//* +// * // Type of recovery procedure. These should be used as bitmask, e.g., // `RecoveryDeviceType_ScrambledWords | RecoveryDeviceType_Matrix` // listing every method supported by the host computer. @@ -149,7 +149,7 @@ func (RecoveryDevice_RecoveryDeviceType) EnumDescriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{17, 0} } -//* +// * // Type of Recovery Word request type WordRequest_WordRequestType int32 @@ -210,7 +210,7 @@ func (WordRequest_WordRequestType) EnumDescriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{18, 0} } -//* +// * // Request: Reset device to default state and ask for device details // @start // @next Features @@ -269,7 +269,7 @@ func (x *Initialize) GetSkipPassphrase() bool { return false } -//* +// * // Request: Ask for device details (no device reset) // @start // @next Features @@ -311,7 +311,7 @@ func (*GetFeatures) Descriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{1} } -//* +// * // Response: Reports various information about the device // @end type Features struct { @@ -569,7 +569,7 @@ func (x *Features) GetNoBackup() bool { return false } -//* +// * // Request: clear session (removes cached PIN, passphrase, etc). // @start // @next Success @@ -611,7 +611,7 @@ func (*ClearSession) Descriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{3} } -//* +// * // Request: change language and/or label of the device // @start // @next Success @@ -711,7 +711,7 @@ func (x *ApplySettings) GetDisplayRotation() uint32 { return 0 } -//* +// * // Request: set flags of the device // @start // @next Success @@ -763,7 +763,7 @@ func (x *ApplyFlags) GetFlags() uint32 { return 0 } -//* +// * // Request: Starts workflow for setting/changing/removing the PIN // @start // @next Success @@ -815,7 +815,7 @@ func (x *ChangePin) GetRemove() bool { return false } -//* +// * // Request: Test if the device is alive, device sends back the message in Success response // @start // @next Success @@ -890,7 +890,7 @@ func (x *Ping) GetPassphraseProtection() bool { return false } -//* +// * // Request: Abort last operation that required user interaction // @start // @next Failure @@ -932,7 +932,7 @@ func (*Cancel) Descriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{8} } -//* +// * // Request: Request a sample of random data generated by hardware RNG. May be used for testing. // @start // @next Entropy @@ -984,7 +984,7 @@ func (x *GetEntropy) GetSize() uint32 { return 0 } -//* +// * // Response: Reply with random data generated by internal RNG // @end type Entropy struct { @@ -1034,7 +1034,7 @@ func (x *Entropy) GetEntropy() []byte { return nil } -//* +// * // Request: Request device to wipe all sensitive data and settings // @start // @next Success @@ -1077,7 +1077,7 @@ func (*WipeDevice) Descriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{11} } -//* +// * // Request: Load seed and related internal settings from the computer // @start // @next Success @@ -1190,7 +1190,7 @@ func (x *LoadDevice) GetU2FCounter() uint32 { return 0 } -//* +// * // Request: Ask device to do initialization involving user interaction // @start // @next EntropyRequest @@ -1312,7 +1312,7 @@ func (x *ResetDevice) GetNoBackup() bool { return false } -//* +// * // Request: Perform backup of the device seed if not backed up using ResetDevice // @start // @next Success @@ -1354,7 +1354,7 @@ func (*BackupDevice) Descriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{14} } -//* +// * // Response: Ask for additional entropy from host computer // @next EntropyAck type EntropyRequest struct { @@ -1395,7 +1395,7 @@ func (*EntropyRequest) Descriptor() ([]byte, []int) { return file_messages_management_proto_rawDescGZIP(), []int{15} } -//* +// * // Request: Provide additional entropy for seed generation function // @next Success type EntropyAck struct { @@ -1445,7 +1445,7 @@ func (x *EntropyAck) GetEntropy() []byte { return nil } -//* +// * // Request: Start recovery workflow asking user for specific words of mnemonic // Used to recovery device safely even on untrusted computer. // @start @@ -1567,7 +1567,7 @@ func (x *RecoveryDevice) GetDryRun() bool { return false } -//* +// * // Response: Device is waiting for user to enter word of the mnemonic // Its position is shown only on device's internal display. // @next WordAck @@ -1618,7 +1618,7 @@ func (x *WordRequest) GetType() WordRequest_WordRequestType { return WordRequest_WordRequestType_Plain } -//* +// * // Request: Computer replies with word from the mnemonic // @next WordRequest // @next Success @@ -1670,7 +1670,7 @@ func (x *WordAck) GetWord() string { return "" } -//* +// * // Request: Set U2F counter // @start // @next Success diff --git a/accounts/usbwallet/trezor/messages.pb.go b/accounts/usbwallet/trezor/messages.pb.go index 430d0bcd7459..d8d298650d96 100644 --- a/accounts/usbwallet/trezor/messages.pb.go +++ b/accounts/usbwallet/trezor/messages.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v5.28.1 +// protoc v5.28.0 // source: messages.proto package trezor @@ -25,7 +25,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -//* +// * // Mapping between TREZOR wire identifier (uint) and a protobuf message type MessageType int32 diff --git a/beacon/engine/gen_ed.go b/beacon/engine/gen_ed.go index b26de62c5114..632f9bd839f1 100644 --- a/beacon/engine/gen_ed.go +++ b/beacon/engine/gen_ed.go @@ -30,7 +30,7 @@ func (e ExecutableData) MarshalJSON() ([]byte, error) { ExtraData hexutil.Bytes `json:"extraData" gencodec:"required"` BaseFeePerGas *hexutil.Big `json:"baseFeePerGas" gencodec:"required"` BlockHash common.Hash `json:"blockHash" gencodec:"required"` - Transactions []hexutil.Bytes `json:"transactions" gencodec:"required"` + Transactions []hexutil.Bytes `json:"transactions"` Withdrawals []*types.Withdrawal `json:"withdrawals"` BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` @@ -87,7 +87,7 @@ func (e *ExecutableData) UnmarshalJSON(input []byte) error { ExtraData *hexutil.Bytes `json:"extraData" gencodec:"required"` BaseFeePerGas *hexutil.Big `json:"baseFeePerGas" gencodec:"required"` BlockHash *common.Hash `json:"blockHash" gencodec:"required"` - Transactions []hexutil.Bytes `json:"transactions" gencodec:"required"` + Transactions []hexutil.Bytes `json:"transactions"` Withdrawals []*types.Withdrawal `json:"withdrawals"` BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"` ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"` @@ -153,12 +153,11 @@ func (e *ExecutableData) UnmarshalJSON(input []byte) error { return errors.New("missing required field 'blockHash' for ExecutableData") } e.BlockHash = *dec.BlockHash - if dec.Transactions == nil { - return errors.New("missing required field 'transactions' for ExecutableData") - } - e.Transactions = make([][]byte, len(dec.Transactions)) - for k, v := range dec.Transactions { - e.Transactions[k] = v + if dec.Transactions != nil { + e.Transactions = make([][]byte, len(dec.Transactions)) + for k, v := range dec.Transactions { + e.Transactions[k] = v + } } if dec.Withdrawals != nil { e.Withdrawals = dec.Withdrawals diff --git a/beacon/engine/types.go b/beacon/engine/types.go index 464a21e41143..4f26dffe16e0 100644 --- a/beacon/engine/types.go +++ b/beacon/engine/types.go @@ -99,7 +99,7 @@ type ExecutableData struct { ExtraData []byte `json:"extraData" gencodec:"required"` BaseFeePerGas *big.Int `json:"baseFeePerGas" gencodec:"required"` BlockHash common.Hash `json:"blockHash" gencodec:"required"` - Transactions [][]byte `json:"transactions" gencodec:"required"` + Transactions [][]byte `json:"transactions"` Withdrawals []*types.Withdrawal `json:"withdrawals"` BlobGasUsed *uint64 `json:"blobGasUsed"` ExcessBlobGas *uint64 `json:"excessBlobGas"` diff --git a/miner/taiko_miner.go b/miner/taiko_miner.go index 2503c005f500..4bc09792a2da 100644 --- a/miner/taiko_miner.go +++ b/miner/taiko_miner.go @@ -24,7 +24,7 @@ func (miner *Miner) SealBlockWith( baseFeePerGas *big.Int, withdrawals types.Withdrawals, ) (*types.Block, error) { - return miner.SealBlockWith(parent, timestamp, blkMeta, baseFeePerGas, withdrawals) + return miner.sealBlockWith(parent, timestamp, blkMeta, baseFeePerGas, withdrawals) } // BuildTransactionsLists builds multiple transactions lists which satisfy all the given limits.