fix(server::user_agent): useragents now self-sign themselves on bootstrap

This commit is contained in:
hdbg
2026-04-08 12:34:32 +02:00
parent 1585f90cae
commit 6b8da567dd
36 changed files with 352 additions and 229 deletions

View File

@@ -414,6 +414,79 @@ class GasLimitExceededViolation extends $pb.GeneratedMessage {
void clearMaxPriorityFeePerGas() => $_clearField(2);
}
class EvalViolation_ChainIdMismatch extends $pb.GeneratedMessage {
factory EvalViolation_ChainIdMismatch({
$fixnum.Int64? expected,
$fixnum.Int64? actual,
}) {
final result = create();
if (expected != null) result.expected = expected;
if (actual != null) result.actual = actual;
return result;
}
EvalViolation_ChainIdMismatch._();
factory EvalViolation_ChainIdMismatch.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory EvalViolation_ChainIdMismatch.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'EvalViolation.ChainIdMismatch',
package:
const $pb.PackageName(_omitMessageNames ? '' : 'arbiter.shared.evm'),
createEmptyInstance: create)
..a<$fixnum.Int64>(
1, _omitFieldNames ? '' : 'expected', $pb.PbFieldType.OU6,
defaultOrMaker: $fixnum.Int64.ZERO)
..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'actual', $pb.PbFieldType.OU6,
defaultOrMaker: $fixnum.Int64.ZERO)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
EvalViolation_ChainIdMismatch clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
EvalViolation_ChainIdMismatch copyWith(
void Function(EvalViolation_ChainIdMismatch) updates) =>
super.copyWith(
(message) => updates(message as EvalViolation_ChainIdMismatch))
as EvalViolation_ChainIdMismatch;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static EvalViolation_ChainIdMismatch create() =>
EvalViolation_ChainIdMismatch._();
@$core.override
EvalViolation_ChainIdMismatch createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static EvalViolation_ChainIdMismatch getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<EvalViolation_ChainIdMismatch>(create);
static EvalViolation_ChainIdMismatch? _defaultInstance;
@$pb.TagNumber(1)
$fixnum.Int64 get expected => $_getI64(0);
@$pb.TagNumber(1)
set expected($fixnum.Int64 value) => $_setInt64(0, value);
@$pb.TagNumber(1)
$core.bool hasExpected() => $_has(0);
@$pb.TagNumber(1)
void clearExpected() => $_clearField(1);
@$pb.TagNumber(2)
$fixnum.Int64 get actual => $_getI64(1);
@$pb.TagNumber(2)
set actual($fixnum.Int64 value) => $_setInt64(1, value);
@$pb.TagNumber(2)
$core.bool hasActual() => $_has(1);
@$pb.TagNumber(2)
void clearActual() => $_clearField(2);
}
enum EvalViolation_Kind {
invalidTarget,
gasLimitExceeded,
@@ -421,6 +494,7 @@ enum EvalViolation_Kind {
volumetricLimitExceeded,
invalidTime,
invalidTransactionType,
chainIdMismatch,
notSet
}
@@ -432,6 +506,7 @@ class EvalViolation extends $pb.GeneratedMessage {
$0.Empty? volumetricLimitExceeded,
$0.Empty? invalidTime,
$0.Empty? invalidTransactionType,
EvalViolation_ChainIdMismatch? chainIdMismatch,
}) {
final result = create();
if (invalidTarget != null) result.invalidTarget = invalidTarget;
@@ -442,6 +517,7 @@ class EvalViolation extends $pb.GeneratedMessage {
if (invalidTime != null) result.invalidTime = invalidTime;
if (invalidTransactionType != null)
result.invalidTransactionType = invalidTransactionType;
if (chainIdMismatch != null) result.chainIdMismatch = chainIdMismatch;
return result;
}
@@ -462,6 +538,7 @@ class EvalViolation extends $pb.GeneratedMessage {
4: EvalViolation_Kind.volumetricLimitExceeded,
5: EvalViolation_Kind.invalidTime,
6: EvalViolation_Kind.invalidTransactionType,
7: EvalViolation_Kind.chainIdMismatch,
0: EvalViolation_Kind.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
@@ -469,7 +546,7 @@ class EvalViolation extends $pb.GeneratedMessage {
package:
const $pb.PackageName(_omitMessageNames ? '' : 'arbiter.shared.evm'),
createEmptyInstance: create)
..oo(0, [1, 2, 3, 4, 5, 6])
..oo(0, [1, 2, 3, 4, 5, 6, 7])
..a<$core.List<$core.int>>(
1, _omitFieldNames ? '' : 'invalidTarget', $pb.PbFieldType.OY)
..aOM<GasLimitExceededViolation>(
@@ -483,6 +560,9 @@ class EvalViolation extends $pb.GeneratedMessage {
subBuilder: $0.Empty.create)
..aOM<$0.Empty>(6, _omitFieldNames ? '' : 'invalidTransactionType',
subBuilder: $0.Empty.create)
..aOM<EvalViolation_ChainIdMismatch>(
7, _omitFieldNames ? '' : 'chainIdMismatch',
subBuilder: EvalViolation_ChainIdMismatch.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -510,6 +590,7 @@ class EvalViolation extends $pb.GeneratedMessage {
@$pb.TagNumber(4)
@$pb.TagNumber(5)
@$pb.TagNumber(6)
@$pb.TagNumber(7)
EvalViolation_Kind whichKind() => _EvalViolation_KindByTag[$_whichOneof(0)]!;
@$pb.TagNumber(1)
@$pb.TagNumber(2)
@@ -517,6 +598,7 @@ class EvalViolation extends $pb.GeneratedMessage {
@$pb.TagNumber(4)
@$pb.TagNumber(5)
@$pb.TagNumber(6)
@$pb.TagNumber(7)
void clearKind() => $_clearField($_whichOneof(0));
@$pb.TagNumber(1)
@@ -582,6 +664,18 @@ class EvalViolation extends $pb.GeneratedMessage {
void clearInvalidTransactionType() => $_clearField(6);
@$pb.TagNumber(6)
$0.Empty ensureInvalidTransactionType() => $_ensure(5);
@$pb.TagNumber(7)
EvalViolation_ChainIdMismatch get chainIdMismatch => $_getN(6);
@$pb.TagNumber(7)
set chainIdMismatch(EvalViolation_ChainIdMismatch value) =>
$_setField(7, value);
@$pb.TagNumber(7)
$core.bool hasChainIdMismatch() => $_has(6);
@$pb.TagNumber(7)
void clearChainIdMismatch() => $_clearField(7);
@$pb.TagNumber(7)
EvalViolation_ChainIdMismatch ensureChainIdMismatch() => $_ensure(6);
}
/// Transaction was classified but no grant covers it

View File

@@ -195,12 +195,31 @@ const EvalViolation$json = {
'9': 0,
'10': 'invalidTransactionType'
},
{
'1': 'chain_id_mismatch',
'3': 7,
'4': 1,
'5': 11,
'6': '.arbiter.shared.evm.EvalViolation.ChainIdMismatch',
'9': 0,
'10': 'chainIdMismatch'
},
],
'3': [EvalViolation_ChainIdMismatch$json],
'8': [
{'1': 'kind'},
],
};
@$core.Deprecated('Use evalViolationDescriptor instead')
const EvalViolation_ChainIdMismatch$json = {
'1': 'ChainIdMismatch',
'2': [
{'1': 'expected', '3': 1, '4': 1, '5': 4, '10': 'expected'},
{'1': 'actual', '3': 2, '4': 1, '5': 4, '10': 'actual'},
],
};
/// Descriptor for `EvalViolation`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List evalViolationDescriptor = $convert.base64Decode(
'Cg1FdmFsVmlvbGF0aW9uEicKDmludmFsaWRfdGFyZ2V0GAEgASgMSABSDWludmFsaWRUYXJnZX'
@@ -211,7 +230,10 @@ final $typed_data.Uint8List evalViolationDescriptor = $convert.base64Decode(
'YuRW1wdHlIAFIXdm9sdW1ldHJpY0xpbWl0RXhjZWVkZWQSOwoMaW52YWxpZF90aW1lGAUgASgL'
'MhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5SABSC2ludmFsaWRUaW1lElIKGGludmFsaWRfdHJhbn'
'NhY3Rpb25fdHlwZRgGIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAUhZpbnZhbGlkVHJh'
'bnNhY3Rpb25UeXBlQgYKBGtpbmQ=');
'bnNhY3Rpb25UeXBlEl8KEWNoYWluX2lkX21pc21hdGNoGAcgASgLMjEuYXJiaXRlci5zaGFyZW'
'QuZXZtLkV2YWxWaW9sYXRpb24uQ2hhaW5JZE1pc21hdGNoSABSD2NoYWluSWRNaXNtYXRjaBpF'
'Cg9DaGFpbklkTWlzbWF0Y2gSGgoIZXhwZWN0ZWQYASABKARSCGV4cGVjdGVkEhYKBmFjdHVhbB'
'gCIAEoBFIGYWN0dWFsQgYKBGtpbmQ=');
@$core.Deprecated('Use noMatchingGrantErrorDescriptor instead')
const NoMatchingGrantError$json = {

View File

@@ -24,12 +24,10 @@ class AuthChallengeRequest extends $pb.GeneratedMessage {
factory AuthChallengeRequest({
$core.List<$core.int>? pubkey,
$core.String? bootstrapToken,
KeyType? keyType,
}) {
final result = create();
if (pubkey != null) result.pubkey = pubkey;
if (bootstrapToken != null) result.bootstrapToken = bootstrapToken;
if (keyType != null) result.keyType = keyType;
return result;
}
@@ -50,8 +48,6 @@ class AuthChallengeRequest extends $pb.GeneratedMessage {
..a<$core.List<$core.int>>(
1, _omitFieldNames ? '' : 'pubkey', $pb.PbFieldType.OY)
..aOS(2, _omitFieldNames ? '' : 'bootstrapToken')
..aE<KeyType>(3, _omitFieldNames ? '' : 'keyType',
enumValues: KeyType.values)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -90,15 +86,6 @@ class AuthChallengeRequest extends $pb.GeneratedMessage {
$core.bool hasBootstrapToken() => $_has(1);
@$pb.TagNumber(2)
void clearBootstrapToken() => $_clearField(2);
@$pb.TagNumber(3)
KeyType get keyType => $_getN(2);
@$pb.TagNumber(3)
set keyType(KeyType value) => $_setField(3, value);
@$pb.TagNumber(3)
$core.bool hasKeyType() => $_has(2);
@$pb.TagNumber(3)
void clearKeyType() => $_clearField(3);
}
class AuthChallenge extends $pb.GeneratedMessage {

View File

@@ -14,31 +14,6 @@ import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class KeyType extends $pb.ProtobufEnum {
static const KeyType KEY_TYPE_UNSPECIFIED =
KeyType._(0, _omitEnumNames ? '' : 'KEY_TYPE_UNSPECIFIED');
static const KeyType KEY_TYPE_ED25519 =
KeyType._(1, _omitEnumNames ? '' : 'KEY_TYPE_ED25519');
static const KeyType KEY_TYPE_ECDSA_SECP256K1 =
KeyType._(2, _omitEnumNames ? '' : 'KEY_TYPE_ECDSA_SECP256K1');
static const KeyType KEY_TYPE_RSA =
KeyType._(3, _omitEnumNames ? '' : 'KEY_TYPE_RSA');
static const $core.List<KeyType> values = <KeyType>[
KEY_TYPE_UNSPECIFIED,
KEY_TYPE_ED25519,
KEY_TYPE_ECDSA_SECP256K1,
KEY_TYPE_RSA,
];
static final $core.List<KeyType?> _byValue =
$pb.ProtobufEnum.$_initByValueList(values, 3);
static KeyType? valueOf($core.int value) =>
value < 0 || value >= _byValue.length ? null : _byValue[value];
const KeyType._(super.value, super.name);
}
class AuthResult extends $pb.ProtobufEnum {
static const AuthResult AUTH_RESULT_UNSPECIFIED =
AuthResult._(0, _omitEnumNames ? '' : 'AUTH_RESULT_UNSPECIFIED');

View File

@@ -15,22 +15,6 @@ import 'dart:convert' as $convert;
import 'dart:core' as $core;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use keyTypeDescriptor instead')
const KeyType$json = {
'1': 'KeyType',
'2': [
{'1': 'KEY_TYPE_UNSPECIFIED', '2': 0},
{'1': 'KEY_TYPE_ED25519', '2': 1},
{'1': 'KEY_TYPE_ECDSA_SECP256K1', '2': 2},
{'1': 'KEY_TYPE_RSA', '2': 3},
],
};
/// Descriptor for `KeyType`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List keyTypeDescriptor = $convert.base64Decode(
'CgdLZXlUeXBlEhgKFEtFWV9UWVBFX1VOU1BFQ0lGSUVEEAASFAoQS0VZX1RZUEVfRUQyNTUxOR'
'ABEhwKGEtFWV9UWVBFX0VDRFNBX1NFQ1AyNTZLMRACEhAKDEtFWV9UWVBFX1JTQRAD');
@$core.Deprecated('Use authResultDescriptor instead')
const AuthResult$json = {
'1': 'AuthResult',
@@ -67,14 +51,6 @@ const AuthChallengeRequest$json = {
'10': 'bootstrapToken',
'17': true
},
{
'1': 'key_type',
'3': 3,
'4': 1,
'5': 14,
'6': '.arbiter.user_agent.auth.KeyType',
'10': 'keyType'
},
],
'8': [
{'1': '_bootstrap_token'},
@@ -84,9 +60,8 @@ const AuthChallengeRequest$json = {
/// Descriptor for `AuthChallengeRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List authChallengeRequestDescriptor = $convert.base64Decode(
'ChRBdXRoQ2hhbGxlbmdlUmVxdWVzdBIWCgZwdWJrZXkYASABKAxSBnB1YmtleRIsCg9ib290c3'
'RyYXBfdG9rZW4YAiABKAlIAFIOYm9vdHN0cmFwVG9rZW6IAQESOwoIa2V5X3R5cGUYAyABKA4y'
'IC5hcmJpdGVyLnVzZXJfYWdlbnQuYXV0aC5LZXlUeXBlUgdrZXlUeXBlQhIKEF9ib290c3RyYX'
'BfdG9rZW4=');
'RyYXBfdG9rZW4YAiABKAlIAFIOYm9vdHN0cmFwVG9rZW6IAQFCEgoQX2Jvb3RzdHJhcF90b2tl'
'bg==');
@$core.Deprecated('Use authChallengeDescriptor instead')
const AuthChallenge$json = {