What part of speech is the word 'bolt' in the adverb 'bolt upright'?
In the let's-sort-out-the-'adverb'-mess approach that linguists at the University of Sussex, for example, advocate it's a 'degree modifier' or more precisely a secondary modifier subclass adjective (in the 'he was sitting bolt upright' usage) modifier. From the University of Sussex:
A degree modifier modifies an adjective or an adverb. Semantically, a degree modifier expresses the degree to which some quality is present. Here are some frames for degree modifiers:
This is a(n) ___ good book.
She poured the wine ___ carefully. Examples are very, so, really, rather, extremely, and the informal items kind of and sort of.
(But note the peculiar behaviour of these last two in the first frame: This is kind of a good book.)
Degree modifiers ending in -ly can be constructed with some freedom: amazingly, frightfully, awfully, terrifically, and so on. Traditional grammarians assigned these things to the class of”adverbs”, but degree modifiers are quite distinct from adverbs in their grammatical behaviour, and most linguists today prefer to recognize them as a distinct class. A few linguists call them “intensifiers”, but this label is inappropriate, since not all these words “intensify” the meaning of the adjective or adverb which is modified. English degree modifiers have no inflectional or derivational properties.
The number of secondary modifiers not ending in -ly is fairly small, and these are usually categorial polysemes of adjectives
(stony broke(!), dead slow, plain stupid, wide awake ...; piping hot (?), finger-lickin' good(?) ...; stone cold sober)
but there is the apparent odd exception (stock still).
(The comparable arrow-straight has obviously developed into a compound adjective.)
[I prefer the term 'secondary modifier' because many of these have distinct semantic content over and above an intensifying (etc) function (daringly low, dashingly handsome, deceptively spacious, oppressively close ...; contrast bland old 'very'.]
"Bolt" has several meanings, it can be a special screw mainly used on machines as shown in these pictures.
In picture four you see two bolts, one standing upright on its foot and one on its head.
Of course, I am not sure if this interpretation is the correct one. But "bolt upright" can't be explained with "a flash from the sky" nor with "arrow". "Bolt upright" is a shortened form of "upright like a bolt".
I would say bolt is a noun used as compound element of a two-part adjective or adverb.