Skip to content

Commit

Permalink
Add TransactionId
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanoroshiba committed Aug 30, 2024
1 parent 7e9d618 commit fc5b37b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
14 changes: 8 additions & 6 deletions core/types/deposit_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
primitivev1 "buf.build/gen/go/astria/primitives/protocolbuffers/go/astria/primitive/v1"
)

var _ TxData = &DepositTx{}
Expand All @@ -24,10 +25,11 @@ type DepositTx struct {
// if this is an ERC20 mint, the following field is set
// to the `mint` function calldata.
Data []byte
// the hash of the transaction which initiated the deposit
SourceTransactionHash string
// the index of the deposit within the source transaction
SourceTransactionIndex uint32
// the transaction ID of the source action for the deposit, consisting
// of the transaction hash.
TransactionId primitivev1.TransactionId
// index of the deposit's source action within its transaction
IndexOfAction uint32
}

func (tx *DepositTx) copy() TxData {
Expand All @@ -42,8 +44,8 @@ func (tx *DepositTx) copy() TxData {
Gas: tx.Gas,
To: to,
Data: make([]byte, len(tx.Data)),
SourceTransactionHash: tx.SourceTransactionHash,
SourceTransactionIndex: tx.SourceTransactionIndex,
TransactionId: tx.TransactionId,
IndexOfAction: tx.IndexOfAction,
}

if tx.Value != nil {
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/ethereum/go-ethereum
go 1.21

require (
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-92174628237f.1
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.2-00000000000000-92174628237f.2
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240807170122-b074164339d1.2
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-00000000000000-a6f6bbf304ca.2
buf.build/gen/go/astria/execution-apis/grpc/go v1.4.0-20240725205400-4746841755df.1
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.1-20240725205400-4746841755df.1
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-00000000000000-ec254ec7b009.2
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-00000000000000-5ed8a932ed80.2
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0
github.com/Microsoft/go-winio v0.6.1
github.com/VictoriaMetrics/fastcache v1.12.1
Expand Down Expand Up @@ -85,9 +85,9 @@ require (
)

require (
buf.build/gen/go/astria/protocol-apis/grpc/go v1.4.0-00000000000000-71710707f61c.2 // indirect
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.2-20240723183210-71710707f61c.2 // indirect
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-00000000000000-a6f6bbf304ca.1 // indirect
buf.build/gen/go/astria/protocol-apis/grpc/go v1.3.0-20240829200558-cd9207200425.3 // indirect
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.1-20240829200558-cd9207200425.1 // indirect
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-00000000000000-5ed8a932ed80.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/DataDog/zstd v1.4.5 // indirect
Expand Down
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-20240725205400-4746841755d
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-20240725205400-4746841755df.1/go.mod h1:ObExRCUb8BvXp07bgja+eNRXBpdfjPcvE7JvvmTJDns=
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.0-20240627184145-202c666b5a8a.1/go.mod h1:wlbx8NZwEyHsptYNr9xVITSgvO+0b/wWIMwVglYk3fs=
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.1-20240627184145-202c666b5a8a.1/go.mod h1:lBkx3jiHbz6XM0FAkbQEmUFNifgc4x7oi9LuOK/HDbg=
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.1-20240725205400-4746841755df.1 h1:ScB4WN/7wIpWSA9l0HnyJUE6oe1nLKM9b+wMYWv385k=
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.1-20240725205400-4746841755df.1/go.mod h1:lBkx3jiHbz6XM0FAkbQEmUFNifgc4x7oi9LuOK/HDbg=
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.2-00000000000000-193b02425a52.2 h1:+8TaSw1/U7mXxVxCoLFVXSGGb5taFcb4ySOs3O8PiyI=
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.34.2-00000000000000-193b02425a52.2/go.mod h1:M33M+2vbkmDV+hzuRAZKYbStTkC0/ygngsuSCVkeAsk=
Expand All @@ -31,26 +32,38 @@ buf.build/gen/go/astria/primitives/grpc/go v1.3.0-20240626163506-691883836b9e.3/
buf.build/gen/go/astria/primitives/grpc/go v1.4.0-20240626163506-691883836b9e.1/go.mod h1:VU1xcDnHOU7++vCZHJzilQGWAd4m1SWTBYKuo4qx/cg=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.0-20240626163506-691883836b9e.1/go.mod h1:t7VCP+ORGGLNXUOwi6T6h99GntTUT7bWzK6BQa/uTbA=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.1-20240626163506-691883836b9e.1/go.mod h1:pkz/GfhAgZSnDxyZ5bmGUzk6iQNAvyW72pYPkqb7Pbk=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-00000000000000-ec254ec7b009.2 h1:siFkJO0tCPeMEJ0B3hvJfbml1ReeLbIhPrTrmhZlhEA=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-00000000000000-ec254ec7b009.2/go.mod h1:J0Tk7JAHcrhzWNEf1lbePSfFZ1Kp78eAlnO8Cs2ELKg=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240626163506-691883836b9e.2 h1:bCHvCYyvhCPWGc3tpl164ONADbH+nKPSc6KhOWb9tfk=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240626163506-691883836b9e.2/go.mod h1:J0Tk7JAHcrhzWNEf1lbePSfFZ1Kp78eAlnO8Cs2ELKg=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240723183210-d00b2a17ea5b.2 h1:t/+xJg4+o51+athvyaAm1Y0+cUqIksGcvRPtQhQLecA=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240723183210-d00b2a17ea5b.2/go.mod h1:J0Tk7JAHcrhzWNEf1lbePSfFZ1Kp78eAlnO8Cs2ELKg=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240807170122-b074164339d1.2 h1:NAgPX0n2M6R16efrxG9U+M128cl0jwIQl+bV3lQH3qg=
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.34.2-20240807170122-b074164339d1.2/go.mod h1:J0Tk7JAHcrhzWNEf1lbePSfFZ1Kp78eAlnO8Cs2ELKg=
buf.build/gen/go/astria/protocol-apis/grpc/go v1.3.0-20240829200558-cd9207200425.3 h1:VbMUyPDeqHfWaa/djP0KJxkLz+SOXWv+QVPIHOnNLUQ=
buf.build/gen/go/astria/protocol-apis/grpc/go v1.3.0-20240829200558-cd9207200425.3/go.mod h1:w56Mnyd54A4GJVVxOcfSeLmZUmexC72RnKbGvbJEGvs=
buf.build/gen/go/astria/protocol-apis/grpc/go v1.4.0-00000000000000-71710707f61c.2 h1:vTrgoAC11YuG4mNl60LdpBrq8bvXE7wz/mZAq/mJM6o=
buf.build/gen/go/astria/protocol-apis/grpc/go v1.4.0-00000000000000-71710707f61c.2/go.mod h1:zp7gcM2FC51ms15hmqjSvl0u0dqdewRk9sbcjLLcP9M=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.0-20240829200558-cd9207200425.1/go.mod h1:qW3r+DKoZmDOHSoh6OhaJ3UlWBDIyiy+xDx2dpPAoa8=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.1-20240829200558-cd9207200425.1 h1:lJKQjijS4D+fwlWH+lsjAnf95MVTGADBN808pRDeegM=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.1-20240829200558-cd9207200425.1/go.mod h1:D5IXPo9rrnLdjo7SKTJqfZNKA/2WvsNDVZuMpGmGTRk=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.2-00000000000000-71710707f61c.2 h1:0yrBa0INyNxxrS8F8EkDPNP9deg7C0PQqDxSYTRJqH8=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.2-00000000000000-71710707f61c.2/go.mod h1:qixBDfshysfHPFV2sbY/GXrQ1t9ZsWDV9FwHCak2Qfs=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.2-20240723183210-71710707f61c.2 h1:wo28fih7tGzPCNmlVerD6dATjdSFq4ESjBjt9n6XR5M=
buf.build/gen/go/astria/protocol-apis/protocolbuffers/go v1.34.2-20240723183210-71710707f61c.2/go.mod h1:qixBDfshysfHPFV2sbY/GXrQ1t9ZsWDV9FwHCak2Qfs=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.3.0-20240627184145-00f432997496.3/go.mod h1:yfnROiGt3TjHXrSHhatAcpXSdzs9WBcS2536pi5lGBQ=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.4.0-20240627184145-00f432997496.1 h1:qChFBpCSQxZPnGo/3VMTu8+mcmoKY+Xbvu6/qZFHp+4=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.4.0-20240627184145-00f432997496.1/go.mod h1:viF0ZoRvyO5qpIZb1wB3aBBt9WWKOg5x5t6AFKKuKQU=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-00000000000000-5ed8a932ed80.1 h1:YLShZCj89DBmsZElX8BBG/nGtZur/Trq+4gFOBFifio=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-00000000000000-5ed8a932ed80.1/go.mod h1:GTv4t0VFBJ9FEVQDpSpNqIAo0rTZo57Ecw2cQ3T4iZU=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-00000000000000-a6f6bbf304ca.1 h1:dgEuhdEy3Qo9wQEeUExzCDyB6ZO+3HcEGzDYD1W4b8E=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-00000000000000-a6f6bbf304ca.1/go.mod h1:VIUjhfl0w0RnSsPVoO8vignWRPiPH3NIr51g7B4pqp8=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-20240807170122-24ff5bcd4581.1 h1:gFiTuuZgOiBEFSERzlNQln449uuJq1GiWdVgHKofDOs=
buf.build/gen/go/astria/sequencerblock-apis/grpc/go v1.5.1-20240807170122-24ff5bcd4581.1/go.mod h1:ApPfVXzFQPCqlRfdLVR8KxIp9PN1SvfUBXhteZKX/Yk=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.0-20240627184145-00f432997496.1/go.mod h1:qct0qusz8ErM7XwIwAL1fWCIbyjOnlKGUNJwnURUhD8=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.1-20240627184145-00f432997496.1/go.mod h1:KkZ92tBsbbl5HTuN/AbQLkW2ALXsaV5MsEU9PPy/n9c=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-00000000000000-5ed8a932ed80.2 h1:5pWDT2BBWoFTPCmlBciX1iaotjFCpsW9bQgBQLevnCw=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-00000000000000-5ed8a932ed80.2/go.mod h1:4fewEWi70NyYAv2OELu1WOKk0n5s8laCE2ZALsR5Ctc=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-00000000000000-a6f6bbf304ca.2 h1:geaqVAphV3wVtgmFf+Ppsy0EizLHJtOonvZoD3d5fjw=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-00000000000000-a6f6bbf304ca.2/go.mod h1:mwuwdZiuatE+MkpYsAfs1gMCP+IEtaICxc8Vwh4Czvk=
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.34.2-20240627184145-00f432997496.2 h1:s349kECGqPwCKQ1q09lqBR6782/0zDqDez+FEM5PT0s=
Expand Down
8 changes: 4 additions & 4 deletions grpc/execution/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func validateAndUnmarshalSequencerTx(
Gas: 16000,
To: &bac.Erc20Asset.ContractAddress,
Data: calldata,
SourceTransactionHash: deposit.SourceTransactionHash,
SourceTransactionIndex: deposit.SourceTransactionIndex,
TransactionId: *deposit.TransactionId,
IndexOfAction: deposit.IndexOfAction,
}

tx := types.NewTx(&txdata)
Expand All @@ -83,8 +83,8 @@ func validateAndUnmarshalSequencerTx(
To: &recipient,
Value: amount,
Gas: 0,
SourceTransactionHash: deposit.SourceTransactionHash,
SourceTransactionIndex: deposit.SourceTransactionIndex,
TransactionId: *deposit.TransactionId,
IndexOfAction: deposit.IndexOfAction,
}
return types.NewTx(&txdata), nil
} else {
Expand Down

0 comments on commit fc5b37b

Please sign in to comment.