Skip to content

Commit 19bff80

Browse files
authored
Merge pull request #1233 from ConsenSys/revert-1231-consensysengineering-privacy-support-using-precompile-v3
Revert "Privacy Precompile: enables private transactions with extended obfuscated fields"
2 parents 18721a7 + cd945b0 commit 19bff80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+556
-3120
lines changed

accounts/abi/bind/backend.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ type ContractTransactor interface {
8484
SendTransaction(ctx context.Context, tx *types.Transaction, args PrivateTxArgs) error
8585
// PreparePrivateTransaction send the private transaction to Tessera/Constellation's /storeraw API using HTTP
8686
PreparePrivateTransaction(data []byte, privateFrom string) (common.EncryptedPayloadHash, error)
87-
// DistributeTransaction distributes the private transaction payload to its private recipients, and sends the
88-
// private transaction to the nodes PTM, returning a PTM hash for the Private Marker Transaction
89-
DistributeTransaction(ctx context.Context, tx *types.Transaction, args PrivateTxArgs) (string, error)
9087
}
9188

9289
// ContractFilterer defines the methods needed to access log events using one-off

accounts/abi/bind/backends/simulated.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,6 @@ func (b *SimulatedBackend) PreparePrivateTransaction(data []byte, privateFrom st
602602
return common.EncryptedPayloadHash{}, nil
603603
}
604604

605-
func (b *SimulatedBackend) DistributeTransaction(ctx context.Context, tx *types.Transaction, args bind.PrivateTxArgs) (string, error) {
606-
return tx.Hash().String(), nil
607-
}
608-
609605
// FilterLogs executes a log filter operation, blocking during execution and
610606
// returning all the results in one batch.
611607
//

accounts/abi/bind/base.go

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ type TransactOpts struct {
6363
Context context.Context // Network context to support cancellation and timeouts (nil = no timeout)
6464

6565
// Quorum
66-
PrivateFrom string // The public key of the Tessera/Constellation identity to send this tx from.
67-
PrivateFor []string // The public keys of the Tessera/Constellation identities this tx is intended for.
68-
IsUsingPrivacyPrecompile bool
66+
PrivateFrom string // The public key of the Tessera/Constellation identity to send this tx from.
67+
PrivateFor []string // The public keys of the Tessera/Constellation identities this tx is intended for.
6968
}
7069

7170
// FilterOpts is the collection of options to fine tune filtering for events
@@ -277,11 +276,6 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
277276
}
278277
payload = hash.Bytes()
279278
rawTx = c.createPrivateTransaction(rawTx, payload)
280-
281-
if opts.IsUsingPrivacyPrecompile {
282-
rawTx, _ = c.createMarkerTx(opts, rawTx, PrivateTxArgs{PrivateFor: opts.PrivateFor})
283-
opts.PrivateFor = nil
284-
}
285279
}
286280

287281
// Choose signer to sign transaction
@@ -430,25 +424,6 @@ func (c *BoundContract) createPrivateTransaction(tx *types.Transaction, payload
430424
return privateTx
431425
}
432426

433-
// (Quorum) createMarkerTx creates a new public privacy marker transaction for the given private tx, distributing tx to the specified privateFor recipients
434-
func (c *BoundContract) createMarkerTx(opts *TransactOpts, tx *types.Transaction, args PrivateTxArgs) (*types.Transaction, error) {
435-
// Choose signer to sign transaction
436-
if opts.Signer == nil {
437-
return nil, errors.New("no signer to authorize the transaction with")
438-
}
439-
signedTx, err := opts.Signer(types.QuorumPrivateTxSigner{}, opts.From, tx)
440-
if err != nil {
441-
return nil, err
442-
}
443-
444-
hash, err := c.transactor.DistributeTransaction(ensureContext(opts.Context), signedTx, args)
445-
if err != nil {
446-
return nil, err
447-
}
448-
449-
return types.NewTransaction(signedTx.Nonce(), common.QuorumPrivacyPrecompileContractAddress(), tx.Value(), tx.Gas(), tx.GasPrice(), common.FromHex(hash)), nil
450-
}
451-
452427
// ensureContext is a helper method to ensure a context is not nil, even if the
453428
// user specified it as such.
454429
func ensureContext(ctx context.Context) context.Context {

accounts/abi/bind/bind_quorum_test.go

Lines changed: 0 additions & 231 deletions
This file was deleted.

cmd/geth/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@ func checkWhisper(ctx *cli.Context) {
171171
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
172172
stack, cfg := makeConfigNode(ctx)
173173

174-
//Must occur before registering the extension service, as it needs an initialised PTM to be enabled
175-
if err := quorumInitialisePrivacy(ctx); err != nil {
176-
utils.Fatalf("Error initialising Private Transaction Manager: %s", err.Error())
177-
}
178-
179174
// Quorum - returning `ethService` too for the Raft and extension service
180175
backend, ethService := utils.RegisterEthService(stack, &cfg.Eth)
181176

cmd/geth/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ var (
182182
utils.EVMCallTimeOutFlag,
183183
utils.MultitenancyFlag,
184184
utils.RevertReasonFlag,
185-
utils.QuorumEnablePrivacyMarker,
186185
utils.QuorumPTMUnixSocketFlag,
187186
utils.QuorumPTMUrlFlag,
188187
utils.QuorumPTMTimeoutFlag,

cmd/geth/retesteth.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ func (api *RetestethAPI) mineBlock() error {
527527
statedb, pvtstdb,
528528
header, tx, &header.GasUsed, *api.blockchain.GetVMConfig(),
529529
false,
530-
nil,
531530
)
532531
if err != nil {
533532
statedb.RevertToSnapshot(snap)

cmd/geth/usage.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ var AppHelpFlagGroups = []flags.FlagGroup{
260260
utils.MultitenancyFlag,
261261
utils.RevertReasonFlag,
262262
utils.PrivateCacheTrieJournalFlag,
263-
utils.QuorumEnablePrivacyMarker,
264263
},
265264
},
266265
{

cmd/utils/flags.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,6 @@ var (
866866
Value: eth.DefaultConfig.PrivateTrieCleanCacheJournal,
867867
}
868868

869-
QuorumEnablePrivacyMarker = cli.BoolFlag{
870-
Name: "privacymarker.enable",
871-
Usage: "Enable use of privacy marker transactions (PMT) for this node.",
872-
}
873-
874869
// Quorum Private Transaction Manager connection options
875870
QuorumPTMUnixSocketFlag = DirectoryFlag{
876871
Name: "ptm.socket",
@@ -1715,8 +1710,6 @@ func setQuorumConfig(ctx *cli.Context, cfg *eth.Config) error {
17151710
cfg.EVMCallTimeOut = time.Duration(ctx.GlobalInt(EVMCallTimeOutFlag.Name)) * time.Second
17161711
cfg.EnableMultitenancy = ctx.GlobalBool(MultitenancyFlag.Name)
17171712
cfg.SaveRevertReason = ctx.GlobalBool(RevertReasonFlag.Name)
1718-
cfg.QuorumPrivacyMarkerTransactionsEnabled = ctx.GlobalBool(QuorumEnablePrivacyMarker.Name)
1719-
17201713
setIstanbul(ctx, cfg)
17211714
setRaft(ctx, cfg)
17221715
if ctx.GlobalIsSet(PrivateCacheTrieJournalFlag.Name) {

0 commit comments

Comments
 (0)